Delete Await Disconnect & Method API

This commit is contained in:
2025-02-11 12:14:24 +08:00
parent 2a93fa787f
commit 7c1d17079a
22 changed files with 21 additions and 226 deletions

View File

@@ -25,18 +25,17 @@ const apiGetAdminCollaborationStatusCountDashboard = async ({
// console.log("Ini Response", await response.json());
return await response.json().catch(() => null);
}
const apiGetAdminCollaborationStatusById = async ({ status, page, search }: {
const apiGetAdminCollaborationStatusById = async ({ status, page}: {
status: "Publish" | "Reject",
page: string,
search: string
}) => {
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
if (!token) return await token.json().catch(() => null);
const isPage = page ? `?page=${page}` : "";
const isSearch = search ? `&search=${search}` : "";
const response = await fetch(`/api/admin/collaboration/${status}${isPage}${isSearch}`, {
const response = await fetch(`/api/admin/collaboration/${status}${isPage}`, {
headers: {
"Content-Type": "application/json",
Accept: "application/json",