Add: - utils/colorActivationForBadge.ts Fix: - app/(application)/admin/event/type-create.tsx - app/(application)/admin/event/type-of-event.tsx - app/(application)/admin/event/type-update.tsx - service/api-admin/api-admin-event.ts - service/api-admin/api-master-admin.ts - service/api-client/api-event.ts ### No Issue
63 lines
1.2 KiB
TypeScript
63 lines
1.2 KiB
TypeScript
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;
|
|
}
|
|
}
|
|
|
|
export async function apiAdminEventListOfParticipants({ id }: { id: string }) {
|
|
try {
|
|
const response = await apiConfig.get(
|
|
`/mobile/admin/event/${id}/participants`
|
|
);
|
|
return response.data;
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
|