feat: users management

This commit is contained in:
swve 2024-01-22 20:37:11 +01:00
parent a552300e15
commit 689625b0d5
22 changed files with 621 additions and 36 deletions

View file

@ -75,7 +75,15 @@ export const errorHandling = (res: any) => {
return res.json();
};
export const getResponseMetadata = async (fetch_result: any) => {
type CustomResponseTyping = {
success: boolean;
data: any;
status: number;
HTTPmessage: string;
};
export const getResponseMetadata = async (fetch_result: any): Promise<CustomResponseTyping> => {
const json = await fetch_result.json();
if (fetch_result.status === 200) {
return { success: true, data: json, status: fetch_result.status, HTTPmessage: fetch_result.statusText };