Merge pull request #314 from bipproduction/Nico/17-feb-25

Fix Routing Folder API Admin
This commit is contained in:
Bagasbanuna02
2025-02-17 10:11:37 +08:00
committed by GitHub
20 changed files with 38 additions and 37 deletions

View File

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

View File

@@ -38,10 +38,10 @@ const apiGetAdminDonasiKategoriCountDashboard = async () => {
}
const apiGetAdminDonasiByStatus = async ({
status,
name,
page,
search }: {
status: "Publish" | "Review" | "Reject",
name: "Publish" | "Review" | "Reject",
page: string;
search: string;
}) => {
@@ -52,7 +52,7 @@ const apiGetAdminDonasiByStatus = async ({
const isPage = page ? `?page=${page}` : "";
const isSearch = search ? `&search=${search}` : "";
const response = await fetch(
`/api/admin/donasi/${status}${isPage}${isSearch}`,
`/api/admin/donasi/status/${name}${isPage}${isSearch}`,
{
headers: {
"Content-Type": "application/json",

View File

@@ -54,7 +54,7 @@ function TableStatus() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminDonasiByStatus({
status: "Publish",
name: "Publish",
page: `${isActivePage}`,
search: isSearch
})

View File

@@ -56,7 +56,7 @@ function TableStatus() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminDonasiByStatus({
status: "Reject",
name: "Reject",
page: `${isActivePage}`,
search: isSearch
})

View File

@@ -68,7 +68,7 @@ function TableStatus() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminDonasiByStatus({
status: "Review",
name: "Review",
page: `${isActivePage}`,
search: isSearch
})

View File

@@ -27,8 +27,8 @@ const apiGetAdminInvestasiCountDashboard = async ({ name }:
return await response.json().catch(() => null);
};
const apiGetAdminInvestasiByStatus = async ({ status, page, search }: {
status: "Publish" | "Review" | "Reject",
const apiGetAdminInvestasiByStatus = async ({ name, page, search }: {
name: "Publish" | "Review" | "Reject",
page: string,
search: string
}) => {
@@ -40,7 +40,7 @@ const apiGetAdminInvestasiByStatus = async ({ status, page, search }: {
const isPage = page ? `?page=${page}` : "";
const isSearch = search ? `&search=${search}` : "";
const response = await fetch(`/api/admin/investasi/status/${status}${isPage}${isSearch}`, {
const response = await fetch(`/api/admin/investasi/status/${name}${isPage}${isSearch}`, {
method: "GET",
headers: {
"Content-Type": "application/json",

View File

@@ -241,6 +241,7 @@ export function AdminInvestasi_ViewDaftarTransaksi() {
data={listStatus?.map(status => ({
value: status.id,
label: status.name,
})) || []}
onChange={(val: any) => {
console.log(val)

View File

@@ -62,7 +62,7 @@ function TableView() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminInvestasiByStatus({
status: "Publish",
name: "Publish",
page: `${activePage}`,
search: isSearch,
});

View File

@@ -130,7 +130,7 @@ function TableView() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminInvestasiByStatus({
status: "Reject",
name: "Reject",
page: `${activePage}`,
search: isSearch,
});

View File

@@ -66,7 +66,7 @@ function TableView() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminInvestasiByStatus({
status: "Review",
name: "Review",
page: `${activePage}`,
search: isSearch,
});

View File

@@ -76,7 +76,7 @@ export default function AdminJob_ViewTavleReview() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminJobByStatus({
status: "Review",
name: "Review",
page: `${activePage}`,
search: isSearch
})

View File

@@ -56,7 +56,7 @@ function TableStatus() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminJobByStatus({
status: "Publish",
name: "Publish",
page: `${activePage}`,
search: isSearch
})

View File

@@ -64,7 +64,7 @@ function TableStatus() {
const loadInitialData = async () => {
try {
const response = await apiGetAdminJobByStatus({
status: "Reject",
name: "Reject",
page: `${activePage}`,
search: isSearch
});

View File

@@ -39,11 +39,11 @@ const apiGetAdminJobArsipCount = async () => {
};
const apiGetAdminJobByStatus = async ({
status,
name,
page,
search
}: {
status: "Publish" | "Review" | "Reject";
name: "Publish" | "Review" | "Reject";
page: string;
search: string;
}) => {
@@ -53,7 +53,7 @@ const apiGetAdminJobByStatus = async ({
const isPage = page ? `?page=${page}` : "";
const isSearch = search ? `&search=${search}` : "";
const response = await fetch(
`/api/admin/job/${status}${isPage}${isSearch}`,
`/api/admin/job/status/${name}${isPage}${isSearch}`,
{
headers: {
"Content-Type": "application/json",