mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init user settings
This commit is contained in:
parent
6fea7ec1af
commit
838a94eec1
17 changed files with 273 additions and 40 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { OrderPayload } from "@components/Dashboard/EditCourseStructure/EditCourseStructure";
|
||||
import { OrderPayload } from "@components/Dashboard/Course/EditCourseStructure/EditCourseStructure";
|
||||
import { getAPIUrl } from "@services/config/config";
|
||||
import { RequestBody, RequestBodyWithAuthHeader, errorHandling } from "@services/utils/ts/requests";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import { RequestBody, errorHandling } from "@services/utils/ts/requests";
|
|||
GET requests are called from the frontend using SWR (https://swr.vercel.app/)
|
||||
*/
|
||||
|
||||
export async function updateProfile(data: any) {
|
||||
const result: any = await fetch(`${getAPIUrl()}users/user_id/` + data.user_id, RequestBody("PUT", data, null))
|
||||
export async function updateProfile(data: any,user_id: number) {
|
||||
const result: any = await fetch(`${getAPIUrl()}users/` + user_id, RequestBody("PUT", data, null))
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue