diff --git a/components/GridRep/index.tsx b/components/GridRep/index.tsx index b43380bb..9920c269 100644 --- a/components/GridRep/index.tsx +++ b/components/GridRep/index.tsx @@ -90,7 +90,7 @@ const GridRep = (props: Props) => { function generateGridImage(position: number) { let url = "" - if (weapons[position]) { + if (weapons[position] && props.grid[position]) { if (weapons[position].element == 0 && props.grid[position].element) { url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapons[position]?.granblue_id}_${props.grid[position].element}.jpg` } else { diff --git a/pages/[username].tsx b/pages/[username].tsx index 0412a142..9b31c295 100644 --- a/pages/[username].tsx +++ b/pages/[username].tsx @@ -340,7 +340,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex : {} let { raids, sortedRaids } = await api.endpoints.raids - .getAll(headers) + .getAll({ params: headers }) .then((response) => organizeRaids(response.data.map((r: any) => r.raid))) // Extract recency filter @@ -377,9 +377,9 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex const response = await api.endpoints.users.getOne({ id: query.username, params: { - params: filters, - ...headers - } + ...filters, + }, + ...headers, }) user = response.data.user diff --git a/pages/new/index.tsx b/pages/new/index.tsx index 3f1ca437..b429e8f4 100644 --- a/pages/new/index.tsx +++ b/pages/new/index.tsx @@ -48,9 +48,9 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex : {} let { raids, sortedRaids } = await api.endpoints.raids - .getAll(headers) + .getAll({ params: headers }) .then((response) => organizeRaids(response.data.map((r: any) => r.raid))) - + return { props: { raids: raids, diff --git a/pages/saved.tsx b/pages/saved.tsx index 6d2b7c9e..ca085629 100644 --- a/pages/saved.tsx +++ b/pages/saved.tsx @@ -343,9 +343,9 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex const headers = accountData ? { headers: { Authorization: `Bearer ${accountData.token}` } } : {} - + let { raids, sortedRaids } = await api.endpoints.raids - .getAll(headers) + .getAll({ params: headers }) .then((response) => organizeRaids(response.data.map((r: any) => r.raid))) // Extract recency filter @@ -377,7 +377,9 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex // Fetch initial set of parties here const response = await api.savedTeams({ - params: filters, + params: { + ...filters, + }, ...headers }) diff --git a/pages/teams.tsx b/pages/teams.tsx index 28997106..3d4e3701 100644 --- a/pages/teams.tsx +++ b/pages/teams.tsx @@ -353,7 +353,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex : {} let { raids, sortedRaids } = await api.endpoints.raids - .getAll(headers) + .getAll({ params: headers }) .then((response) => organizeRaids(response.data.map((r: any) => r.raid))) // Extract recency filter @@ -385,8 +385,10 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex // Fetch initial set of parties here const response = await api.endpoints.parties.getAll({ - params: filters, - ...headers + params: { + ...filters, + }, + ...headers, }) return {