Files
sistem-desa-mandiri/src/module/user/member/lib/api_member.ts
amel 47e8718276 fix: divisi
Deskripsi:
- tampilan kosong saat list grid
- tombol back pada detail divisi
- format tgl pada input laporan divisi
- format desimal pada chart progres tugas laporan divisi
- perbaikan kata event pada laporan divisi
- perbaikan inputan grup pada laporan divisi yg hanya bisa di akses oleh super admin
- perbaikan kalimat belum ada menjadi tidak ada
- menampilkan hanya user dg role coadmin dan user aja saat tambah anggota divisi
- perbaikan pencarian
- loading saat tambah anggota
- tidak memmakai skeleton pada saat hapus dan ganti sstatus admin divisi
- saat edit berhasil maka diarahkan ke halaman detail info divisi
- perbaikan saat bilangan desimal 100.00 pada halaman home

No Issues
2024-11-01 16:59:04 +08:00

47 lines
1.4 KiB
TypeScript

import { IStatusmember } from "./type_member";
export const funGetAllmember = async (path?: string) => {
const response = await fetch(`/api/user${(path) ? path : ''}`, { next: { tags: ['member'] } });
return await response.json().catch(() => null);
}
export const funGetRoleUser = async (path?: string) => {
const response = await fetch(`/api/role-user${(path) ? path : ''}`, { next: { tags: ['member'] } });
return await response.json().catch(() => null);
}
export const funGetOneMember = async (path: string) => {
const response = await fetch(`/api/user/${path}`);
return await response.json().catch(() => null);
}
export const funCreateMember = async (data: FormData) => {
const response = await fetch("/api/user", {
method: "POST",
body: data,
});
return await response.json().catch(() => null);
}
export const funEditStatusMember = async (path: string, data: IStatusmember) => {
const response = await fetch(`/api/user/${path}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
return await response.json().catch(() => null);
}
export const funEditMember = async (path: string, data: FormData) => {
const response = await fetch(`/api/user/${path}`, {
method: "PUT",
body: data,
});
return await response.json().catch(() => null);
}