fix: admin courses
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import { http } from '@/services/api/http'
|
||||
import { endpoints } from '@/services/api/endpoints'
|
||||
|
||||
// Backend (Postman: Auth) is the source of truth. Payloads use the backend's
|
||||
// field names — `name`, `phone`, `password`, `password_confirmation`,
|
||||
// `device_name`, `avatar_media_id` — and responses are passed through unchanged.
|
||||
// Callers (forms / store) are responsible for translating UI-local field names
|
||||
// (firstName/lastName/phoneNumber) into this shape.
|
||||
|
||||
export const apiLogin = (payload) => http.post(endpoints.login, payload)
|
||||
|
||||
export const apiLoginWithCode = (payload) => http.post(endpoints.loginWithCode2Step, payload)
|
||||
@@ -25,7 +31,12 @@ export const apiGetMe = () => http.get(endpoints.me)
|
||||
|
||||
export const apiCompleteProfile = (payload) => http.post(endpoints.completeProfile, payload)
|
||||
|
||||
export const apiUpdateProfile = (payload) => http.put(endpoints.updateProfile, payload)
|
||||
export const apiUpdateProfile = (payload) => http.patch(endpoints.updateProfile, payload)
|
||||
|
||||
// `data` is an array of `{ key, value }` entries. The backend echoes whatever
|
||||
// we POST back from the GET, so this is effectively a free-form key/value bag.
|
||||
export const apiGetRegisterData = () => http.get(endpoints.registerData)
|
||||
export const apiSaveRegisterData = (data) => http.post(endpoints.registerData, { data })
|
||||
|
||||
export const apiGetRegistrationQuestionVideo = () =>
|
||||
http.get(endpoints.getRegistrationQuestionVideo)
|
||||
|
||||
Reference in New Issue
Block a user