- Fitur notifikasi ke admin dari user baru - Notifikasi ke user bahwa akunnya telah terverifikasi Fix: - app/(application)/(user)/notifications/index.tsx - app/(application)/(user)/waiting-room.tsx - app/(application)/admin/super-admin/[id]/index.tsx - app/(application)/admin/user-access/[id]/index.tsx - context/AuthContext.tsx - screens/Home/tabsList.ts - service/api-admin/api-admin-user-access.ts - service/api-device-token.ts - service/api-notifications.ts - types/type-notification-category.ts Add: - lib/routeApp.ts ### No Issue
50 lines
1.0 KiB
TypeScript
50 lines
1.0 KiB
TypeScript
import { apiConfig } from "../api-config";
|
|
|
|
export const apiAdminUserAccessGetAll = async ({
|
|
search,
|
|
category,
|
|
}: {
|
|
search?: string;
|
|
category: "only-user" | "only-admin" | "all-role";
|
|
}) => {
|
|
try {
|
|
const response = await apiConfig.get(`/mobile/admin/user?category=${category}&search=${search}`);
|
|
return response.data;
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
};
|
|
|
|
export const apiAdminUserAccessGetById = async ({ id }: { id: string }) => {
|
|
try {
|
|
const response = await apiConfig.get(`/mobile/admin/user/${id}`);
|
|
return response.data;
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
};
|
|
|
|
export const apiAdminUserAccessUpdateStatus = async ({
|
|
id,
|
|
active,
|
|
role,
|
|
category,
|
|
}: {
|
|
id: string;
|
|
active?: boolean;
|
|
role?: "user" | "admin" | "super_admin";
|
|
category: "access" | "role";
|
|
}) => {
|
|
try {
|
|
const response = await apiConfig.put(`/mobile/admin/user/${id}?category=${category}`, {
|
|
data: {
|
|
active,
|
|
role,
|
|
},
|
|
});
|
|
return response.data;
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
};
|