refactor: pecah lib/api.ts dan constants/Styles.ts per domain
- 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
This commit is contained in:
30
lib/api/banner.api.ts
Normal file
30
lib/api/banner.api.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import api from './client';
|
||||
|
||||
export const apiGetBanner = async ({ user }: { user: string }) => {
|
||||
const response = await api.get(`mobile/banner?user=${user}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiCreateBanner = async (data: FormData) => {
|
||||
const response = await api.post('mobile/banner', data, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
})
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiDeleteBanner = async (data: { user: string }, id: string) => {
|
||||
const response = await api.delete(`mobile/banner/${id}`, { data })
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiGetBannerOne = async ({ user, id }: { user: string, id: string }) => {
|
||||
const response = await api.get(`mobile/banner/${id}?user=${user}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const apiEditBanner = async (data: FormData, id: string) => {
|
||||
const response = await api.put(`mobile/banner/${id}`, data, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
})
|
||||
return response.data;
|
||||
};
|
||||
Reference in New Issue
Block a user