feat: init user settings

This commit is contained in:
swve 2023-12-13 21:30:47 +01:00
parent 6fea7ec1af
commit 838a94eec1
17 changed files with 273 additions and 40 deletions

View file

@ -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";

View file

@ -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;
}