Tambahan
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
export {
|
||||
apiGetAdminCollaborationStatusCountDashboard,
|
||||
apiGetAdminCollaborationStatusById,
|
||||
apiGetAdminCollaborationRoomById
|
||||
|
||||
}
|
||||
const apiGetAdminCollaborationStatusCountDashboard = async ({
|
||||
@@ -23,3 +25,47 @@ const apiGetAdminCollaborationStatusCountDashboard = async ({
|
||||
// console.log("Ini Response", await response.json());
|
||||
return await response.json().catch(() => null);
|
||||
}
|
||||
const apiGetAdminCollaborationStatusById = async ({ status, page, search }: {
|
||||
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}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
Authorization: `Bearer ${token}`,
|
||||
}
|
||||
})
|
||||
|
||||
return await response.json().catch(() => null);
|
||||
}
|
||||
const apiGetAdminCollaborationRoomById = async ({ page, search }: {
|
||||
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/group${isPage}${isSearch}`, {
|
||||
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