Files
sistem-desa-mandiri/src/module/user/profile/lib/api_profile.ts
amel 44ea8c6510 upd: profile
Deskripsi:
- edit profile
- api image
- folder image user

No Issues
2024-08-29 15:50:04 +08:00

15 lines
510 B
TypeScript

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: FormData) => {
const response = await fetch(`/api/user/profile/`, {
method: "PUT",
body: data,
});
return await response.json().catch(() => null);
}