Integrasi API: Admin event & QR Code event
Add: - app/(application)/(user)/event/[id]/confirmation.tsx - screens/Admin/Event/ - service/api-admin/api-admin-event.ts Fix: - app.config.js : penambahan DEEP_LINK_URL untuk url QR Code - app/(application)/(user)/event/create.tsx - app/(application)/admin/event/[id]/[status]/index.tsx - app/(application)/admin/event/[id]/reject-input.tsx - app/(application)/admin/event/[status]/status.tsx - app/(application)/admin/event/index.tsx - app/(application)/admin/job/[id]/[status]/index.tsx - screens/Admin/listPageAdmin.tsx - service/api-config.ts - ### No Issue
This commit is contained in:
49
service/api-admin/api-admin-event.ts
Normal file
49
service/api-admin/api-admin-event.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { apiConfig } from "../api-config";
|
||||
|
||||
export async function apiAdminEvent({
|
||||
category,
|
||||
search,
|
||||
}: {
|
||||
category: "dashboard" | "history" | "publish" | "review" | "type-of-event";
|
||||
search?: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/admin/event?category=${category}&search=${search}`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiAdminEventById({ id }: { id: string }) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/admin/event/${id}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiAdminEventUpdateStatus({
|
||||
id,
|
||||
changeStatus,
|
||||
data,
|
||||
}: {
|
||||
id: string;
|
||||
changeStatus: "publish" | "review" | "reject";
|
||||
data?: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.put(
|
||||
`/mobile/admin/event/${id}?status=${changeStatus}`,
|
||||
{
|
||||
data: data,
|
||||
}
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user