fix (donasi)

deskripsi:
- fix notifikasi to all user
This commit is contained in:
2025-01-20 11:33:00 +08:00
parent 9286de9ecb
commit 5f477a83d8
18 changed files with 419 additions and 185 deletions

View File

@@ -11,7 +11,7 @@ export const apiGetUserId = async () => {
},
});
console.log("Ini di pemanggilan API",await response.json());
console.log("Ini di pemanggilan API", await response.json());
if (!response.ok) return null;
const data: Record<string, any> = await response.json();
@@ -37,3 +37,24 @@ export const apiGetACtivationUser = async () => {
});
return await response.json().catch(() => null);
};
export const apiGetAllUserWithExceptId = async ({
exceptId,
}: {
exceptId?: string;
}) => {
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
if (!token) return await token.json().catch(() => null);
const isExceptId = exceptId ? `?except-id=${exceptId}` : "";
const response = await fetch(`/api/user/all${isExceptId}`, {
headers: {
"Content-Type": "application/json",
Accept: "application/json",
"Access-Control-Allow-Origin": "*",
Authorization: `Bearer ${token}`,
},
});
return await response.json().catch(() => null);
};