Fix file input click event in ThumbnailUpdate component

This commit is contained in:
swve 2024-01-19 22:08:33 +01:00
parent 513d65704f
commit f8ba29b015
5 changed files with 107 additions and 3 deletions

View file

@ -75,6 +75,15 @@ export const errorHandling = (res: any) => {
return res.json();
};
export const getResponseMetadata = async (fetch_result: any) => {
const json = await fetch_result.json();
if (fetch_result.status === 200) {
return { success: true, data: json, status: fetch_result.status, HTTPmessage: fetch_result.statusText };
} else {
return { success: false, data: json, status: fetch_result.status, HTTPmessage: fetch_result.statusText };
}
};
export const revalidateTags = async (tags: string[], orgslug: string) => {
const url = getUriWithOrg(orgslug, "");
tags.forEach((tag) => {