Integrasi API: Event Type

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
This commit is contained in:
2025-10-24 16:22:45 +08:00
parent 1e0b72de22
commit 1bcd1a044f
7 changed files with 304 additions and 77 deletions

View File

@@ -62,7 +62,9 @@ export async function apiAdminMasterBusinessField() {
export async function apiAdminMasterBusinessFieldById({ id }: { id: string }) {
try {
const response = await apiConfig.get(`/mobile/admin/master/business-field/${id}`);
const response = await apiConfig.get(
`/mobile/admin/master/business-field/${id}`
);
return response.data;
} catch (error) {
throw error;
@@ -77,26 +79,91 @@ export async function apiAdminMasterBusinessFieldUpdate({
data: any;
}) {
try {
const response = await apiConfig.put(`/mobile/admin/master/business-field/${id}`, {
data: data,
});
const response = await apiConfig.put(
`/mobile/admin/master/business-field/${id}`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiAdminMasterBusinessFieldCreate({ data }: { data: any }) {
export async function apiAdminMasterBusinessFieldCreate({
data,
}: {
data: any;
}) {
try {
const response = await apiConfig.post(`/mobile/admin/master/business-field`, {
data: data,
});
const response = await apiConfig.post(
`/mobile/admin/master/business-field`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}
// ================== END BUSINNES FIELD ================== //
// ================== START EVENT ================== //
export async function apiAdminMasterTypeOfEvent() {
try {
const response = await apiConfig.get(`/mobile/admin/master/type-of-event`);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiEventCreateTypeOfEvent({ data }: { data: string }) {
try {
const response = await apiConfig.post(
`/mobile/admin/master/type-of-event`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiAdminMasterTypeOfEventGetOne({ id }: { id: string }) {
try {
const response = await apiConfig.get(
`/mobile/admin/master/type-of-event/${id}`
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiAdminMasterTypeOfEventUpdate({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.put(
`/mobile/admin/master/type-of-event/${id}`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}
// ================== END EVENT ================== //