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:
2026-05-12 10:34:31 +08:00
parent 003d92e4e3
commit d299484a98
29 changed files with 1678 additions and 2156 deletions

20
lib/api/client.ts Normal file
View File

@@ -0,0 +1,20 @@
import axios, { AxiosError } from 'axios';
import Constants from 'expo-constants';
import { logError } from '@/lib/errorLogger';
const api = axios.create({
baseURL: Constants?.expoConfig?.extra?.URL_API
});
api.interceptors.response.use(
(response) => response,
(error: AxiosError) => {
const status = error.response?.status;
const url = error.config?.url ?? 'unknown endpoint';
const description = `API error ${status ?? 'network'} on ${url}`;
logError(description, error);
return Promise.reject(error);
}
);
export default api;