Add: app/(application)/admin/job/[id]/[status]/reject-input.tsx screens/Admin/Job/ Fix: Tampilan ke UI sudah terintegrasi ### No Issue
50 lines
957 B
TypeScript
50 lines
957 B
TypeScript
import { apiConfig } from "../api-config";
|
|
|
|
export async function apiAdminJob({
|
|
category,
|
|
search,
|
|
}: {
|
|
category: "dashboard" | "publish" | "review" | "reject";
|
|
search?: string;
|
|
}) {
|
|
try {
|
|
const response = await apiConfig.get(
|
|
`/mobile/admin/job?category=${category}&search=${search}`
|
|
);
|
|
return response.data;
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
export async function apiAdminJobGetById({ id }: { id: string }) {
|
|
try {
|
|
const response = await apiConfig.get(`/mobile/admin/job/${id}`);
|
|
return response.data;
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
export async function apiAdminJobUpdate({
|
|
id,
|
|
status,
|
|
data,
|
|
}: {
|
|
id: string;
|
|
status: "publish" | "review" | "reject";
|
|
data?: string;
|
|
}) {
|
|
try {
|
|
const response = await apiConfig.put(
|
|
`/mobile/admin/job/${id}?status=${status}`,
|
|
{
|
|
data: data,
|
|
}
|
|
);
|
|
return response.data;
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
}
|