feat : update profile

This commit is contained in:
lukman
2024-08-28 14:32:00 +08:00
parent 0d16adbd2f
commit d88e42e8a8
17 changed files with 660 additions and 179 deletions

View File

@@ -0,0 +1,17 @@
import { IEditDataProfile } from "./type_profile";
export const funGetProfileByCookies = async (path?: string) => {
const response = await fetch(`/api/user/profile${(path) ? path : ''}`, { next: { tags: ['profile'] } });
return await response.json().catch(() => null);
}
export const funEditProfileByCookies = async ( data: IEditDataProfile) => {
const response = await fetch(`/api/user/profile/`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
}