refactor: change API proxy from Serverless Functions to Serverless Middlewares to save Function Invocations on vercel

This commit is contained in:
Kentai Radiquum 2024-08-23 03:25:12 +05:00
parent 11343eb7f8
commit ad1c56f593
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
9 changed files with 81 additions and 60 deletions

View file

@ -16,6 +16,7 @@ import { ReleaseInfoRelated } from "#/components/ReleaseInfo/ReleaseInfo.Related
import { ReleaseInfoScreenshots } from "#/components/ReleaseInfo/ReleaseInfo.Screenshots";
import { CommentsMain } from "#/components/Comments/Comments.Main";
import { InfoLists } from "#/components/InfoLists/InfoLists";
import { ENDPOINTS } from "#/api/config";
export const ReleasePage = (props: any) => {
const userStore = useUserStore();
@ -25,7 +26,7 @@ export const ReleasePage = (props: any) => {
function useFetch(id: number) {
let url: string;
url = `/api/release/${id}`;
url = `${ENDPOINTS.release.info}/${id}`;
if (userStore.token) {
url += `?token=${userStore.token}`;
}