mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-30 01:49:40 +05:00
refactor: change API proxy from Serverless Functions to Serverless Middlewares to save Function Invocations on vercel
This commit is contained in:
parent
11343eb7f8
commit
ad1c56f593
9 changed files with 81 additions and 60 deletions
|
@ -16,7 +16,7 @@ export const fetchDataViaGet = async (
|
|||
headers: HEADERS,
|
||||
});
|
||||
if (response.status !== 200) {
|
||||
throw new Error("Error fetching data");
|
||||
return null;
|
||||
}
|
||||
const data = await response.json();
|
||||
return data;
|
||||
|
@ -45,7 +45,7 @@ export const fetchDataViaPost = async (
|
|||
body: body,
|
||||
});
|
||||
if (response.status !== 200) {
|
||||
throw new Error("Error fetching data");
|
||||
return null;
|
||||
}
|
||||
const data = await response.json();
|
||||
return data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue