mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-30 18:09:40 +05:00
feat: add release to collection toast
This commit is contained in:
parent
3aa71acad5
commit
75ab5e1901
3 changed files with 58 additions and 31 deletions
|
@ -34,15 +34,15 @@ export async function tryCatchAPI<T, E = Error>(
|
|||
): Promise<Result<any, any>> {
|
||||
try {
|
||||
const res: Awaited<Response> = await promise;
|
||||
if (!res.ok) {
|
||||
return {
|
||||
data: null,
|
||||
error: {
|
||||
message: res.statusText,
|
||||
code: res.status,
|
||||
},
|
||||
};
|
||||
}
|
||||
// if (!res.ok) {
|
||||
// return {
|
||||
// data: null,
|
||||
// error: {
|
||||
// message: res.statusText,
|
||||
// code: res.status,
|
||||
// },
|
||||
// };
|
||||
// }
|
||||
|
||||
if (
|
||||
res.headers.get("content-length") &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue