Fix various API and rendering bugs
This commit is contained in:
parent
c05f86d012
commit
21b86e4239
5 changed files with 17 additions and 13 deletions
|
|
@ -90,7 +90,7 @@ const GridRep = (props: Props) => {
|
||||||
function generateGridImage(position: number) {
|
function generateGridImage(position: number) {
|
||||||
let url = ""
|
let url = ""
|
||||||
|
|
||||||
if (weapons[position]) {
|
if (weapons[position] && props.grid[position]) {
|
||||||
if (weapons[position].element == 0 && props.grid[position].element) {
|
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`
|
url = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-grid/${weapons[position]?.granblue_id}_${props.grid[position].element}.jpg`
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
||||||
: {}
|
: {}
|
||||||
|
|
||||||
let { raids, sortedRaids } = await api.endpoints.raids
|
let { raids, sortedRaids } = await api.endpoints.raids
|
||||||
.getAll(headers)
|
.getAll({ params: headers })
|
||||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||||
|
|
||||||
// Extract recency filter
|
// Extract recency filter
|
||||||
|
|
@ -377,9 +377,9 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
||||||
const response = await api.endpoints.users.getOne({
|
const response = await api.endpoints.users.getOne({
|
||||||
id: query.username,
|
id: query.username,
|
||||||
params: {
|
params: {
|
||||||
params: filters,
|
...filters,
|
||||||
...headers
|
},
|
||||||
}
|
...headers,
|
||||||
})
|
})
|
||||||
|
|
||||||
user = response.data.user
|
user = response.data.user
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
||||||
: {}
|
: {}
|
||||||
|
|
||||||
let { raids, sortedRaids } = await api.endpoints.raids
|
let { raids, sortedRaids } = await api.endpoints.raids
|
||||||
.getAll(headers)
|
.getAll({ params: headers })
|
||||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
||||||
: {}
|
: {}
|
||||||
|
|
||||||
let { raids, sortedRaids } = await api.endpoints.raids
|
let { raids, sortedRaids } = await api.endpoints.raids
|
||||||
.getAll(headers)
|
.getAll({ params: headers })
|
||||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||||
|
|
||||||
// Extract recency filter
|
// Extract recency filter
|
||||||
|
|
@ -377,7 +377,9 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
||||||
|
|
||||||
// Fetch initial set of parties here
|
// Fetch initial set of parties here
|
||||||
const response = await api.savedTeams({
|
const response = await api.savedTeams({
|
||||||
params: filters,
|
params: {
|
||||||
|
...filters,
|
||||||
|
},
|
||||||
...headers
|
...headers
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
||||||
: {}
|
: {}
|
||||||
|
|
||||||
let { raids, sortedRaids } = await api.endpoints.raids
|
let { raids, sortedRaids } = await api.endpoints.raids
|
||||||
.getAll(headers)
|
.getAll({ params: headers })
|
||||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||||
|
|
||||||
// Extract recency filter
|
// Extract recency filter
|
||||||
|
|
@ -385,8 +385,10 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
||||||
|
|
||||||
// Fetch initial set of parties here
|
// Fetch initial set of parties here
|
||||||
const response = await api.endpoints.parties.getAll({
|
const response = await api.endpoints.parties.getAll({
|
||||||
params: filters,
|
params: {
|
||||||
...headers
|
...filters,
|
||||||
|
},
|
||||||
|
...headers,
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue