- lib/api.ts (879 baris) → 13 file di lib/api/ per domain - constants/Styles.ts (1.275 baris) → 10 file di constants/styles/ per domain - tambah docs/FILE-HEALTH.md dan referensinya ke CLAUDE.md - kedua file lama tetap sebagai re-export — zero breaking changes
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import api from './client';
|
|
|
|
export const apiGetDataHome = async ({ cat, user }: { cat: 'kegiatan' | 'division' | 'progress' | 'dokumen' | 'event' | 'discussion' | 'header' | 'check-late-project', user: string }) => {
|
|
const response = await api.get(`mobile/home?user=${user}&cat=${cat}`);
|
|
return response.data;
|
|
};
|
|
|
|
export const apiGetSearch = async ({ text, user }: { text: string, user: string }) => {
|
|
const response = await api.get(`mobile/home/search?search=${text}&user=${user}`);
|
|
return response.data;
|
|
};
|
|
|
|
export const apiGetNotification = async ({ user, page }: { user: string, page?: number }) => {
|
|
const response = await api.get(`mobile/home/notification?user=${user}&page=${page}`);
|
|
return response.data;
|
|
};
|
|
|
|
export const apiReadOneNotification = async (data: { user: string, id: string }) => {
|
|
const response = await api.put(`/mobile/home/notification`, data)
|
|
return response.data;
|
|
};
|
|
|
|
export const apiReadAllNotification = async (data: { user: string }) => {
|
|
const response = await api.post(`/mobile/home/notification`, data)
|
|
return response.data;
|
|
};
|