fix (donasi)
deskripsi: - fix notifikasi to all user
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user