ignore folder

This commit is contained in:
2026-04-21 06:30:48 +07:00
commit ca00b36f19
70 changed files with 3871 additions and 0 deletions

11
hooks/useApi.ts Normal file
View File

@ -0,0 +1,11 @@
import { AxiosError } from "axios";
export async function useApi<T>(promise: Promise<{ data: T }>): Promise<T> {
try {
const response = await promise;
return response.data;
} catch (error) {
const message = (error as AxiosError<{ message?: string }>).response?.data?.message ?? "Unexpected error";
throw new Error(message);
}
}