add admin checks for admin pages and run biome formating 🔨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 11m8s

This commit is contained in:
2025-07-25 13:31:12 +05:00
parent aedf7cdf7d
commit 9b2f2c1528
127 changed files with 6577 additions and 6334 deletions

View File

@ -11,16 +11,16 @@ export async function handleApiResponse<T>(
response: Response,
fnName?: string,
) {
const responseData = await response.json()
const responseData = await response.json();
if (response.status === 401) {
console.log('response data', responseData)
console.log("response data", responseData);
throw new Error("UNAUTHORIZED");
}
if (response.status === 403) {
throw new Error(
responseData.message ||
"Forbidden; you do not have permission to access this resource.",
"Forbidden; you do not have permission to access this resource.",
);
}
@ -32,7 +32,9 @@ export async function handleApiResponse<T>(
if (!response.ok) {
console.log(`API Error Response from ${fnName}:`, responseData);
throw new Error(responseData.message || responseData.detail || "Something went wrong.");
throw new Error(
responseData.message || responseData.detail || "Something went wrong.",
);
}
return responseData as T;