testing 127.0.0.1 issue

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-07 13:40:07 +08:00
parent 244aa607f7
commit 6624c0d27f
62 changed files with 662 additions and 1889 deletions
+9 -54
View File
@@ -69,12 +69,7 @@ export function AssetsProvider({ children }) {
return await fn();
} catch (err) {
const message = err?.response?.data?.message ?? "Something went wrong.";
toast(message, {
action: {
label: "Close",
onClick: () => {}
}
});
toast(message);
return null;
} finally {
setLoading(false);
@@ -206,12 +201,7 @@ export function AssetsProvider({ children }) {
if (asset) {
setAssets((prev) => [asset, ...prev]);
invalidateListCache();
toast("Asset uploaded successfully.", {
action: {
label: "Close",
onClick: () => {}
}
});
toast("Asset uploaded successfully.");
}
return res.data;
}),
@@ -237,12 +227,7 @@ export function AssetsProvider({ children }) {
setAssets((prev) => prev.map((a) => (a.asset_id === assetId ? asset : a)));
setSelectedAsset(asset);
invalidateListCache();
toast("Asset updated successfully.", {
action: {
label: "Close",
onClick: () => {}
}
});
toast("Asset updated successfully.");
}
return res.data;
}),
@@ -259,12 +244,7 @@ export function AssetsProvider({ children }) {
setAssets((prev) => prev.filter((a) => a.asset_id !== assetId));
setSelectedAsset((prev) => (prev?.asset_id === assetId ? null : prev));
invalidateListCache();
toast("Asset archived.", {
action: {
label: "Close",
onClick: () => {}
}
});
toast("Asset archived.");
return res.data;
}),
[request]
@@ -279,12 +259,7 @@ export function AssetsProvider({ children }) {
});
setAssets((prev) => prev.filter((a) => !ids.includes(a.asset_id)));
invalidateListCache();
toast(`${ids.length} asset(s) archived.`, {
action: {
label: "Close",
onClick: () => {}
}
});
toast(`${ids.length} asset(s) archived.`);
return res.data;
}),
[request]
@@ -299,12 +274,7 @@ export function AssetsProvider({ children }) {
if (asset) {
setAssets((prev) => prev.filter((a) => a.asset_id !== assetId));
invalidateListCache();
toast("Asset restored.", {
action: {
label: "Close",
onClick: () => {}
}
});
toast("Asset restored.");
}
return res.data;
}),
@@ -318,12 +288,7 @@ export function AssetsProvider({ children }) {
const res = await api.patch("/admin/assets/bulk-restore", { ids });
setAssets((prev) => prev.filter((a) => !ids.includes(a.asset_id)));
invalidateListCache();
toast(`${ids.length} asset(s) restored.`, {
action: {
label: "Close",
onClick: () => {}
}
});
toast(`${ids.length} asset(s) restored.`);
return res.data;
}),
[request]
@@ -337,12 +302,7 @@ export function AssetsProvider({ children }) {
setAssets((prev) => prev.filter((a) => a.asset_id !== assetId));
setSelectedAsset((prev) => (prev?.asset_id === assetId ? null : prev));
invalidateListCache();
toast("Asset permanently deleted.", {
action: {
label: "Close",
onClick: () => {}
}
});
toast("Asset permanently deleted.");
return res.data;
}),
[request]
@@ -357,12 +317,7 @@ export function AssetsProvider({ children }) {
});
setAssets((prev) => prev.filter((a) => !ids.includes(a.asset_id)));
invalidateListCache();
toast(`${ids.length} asset(s) permanently deleted.`, {
action: {
label: "Close",
onClick: () => {}
}
});
toast(`${ids.length} asset(s) permanently deleted.`);
return res.data;
}),
[request]