List of raids no longer has root keys
This commit is contained in:
parent
46034e6aad
commit
caf2bca38f
6 changed files with 12 additions and 17 deletions
|
|
@ -78,9 +78,7 @@ const RaidDropdown = React.forwardRef<HTMLSelectElement, Props>(
|
|||
useEffect(() => {
|
||||
api.endpoints.raids
|
||||
.getAll()
|
||||
.then((response) =>
|
||||
organizeRaids(response.data.map((r: any) => r.raid))
|
||||
)
|
||||
.then((response) => organizeRaids(response.data))
|
||||
}, [organizeRaids])
|
||||
|
||||
// Set current raid on mount
|
||||
|
|
|
|||
|
|
@ -166,12 +166,11 @@ const ProfileRoute: React.FC<Props> = (props: Props) => {
|
|||
// Fetch all raids on mount, then find the raid in the URL if present
|
||||
useEffect(() => {
|
||||
api.endpoints.raids.getAll().then((response) => {
|
||||
const cleanRaids: Raid[] = response.data.map((r: any) => r.raid)
|
||||
setRaids(cleanRaids)
|
||||
setRaids(response.data)
|
||||
|
||||
setRaidsLoading(false)
|
||||
|
||||
const raid = cleanRaids.find((r) => r.slug === raidSlug)
|
||||
const raid = response.data.find((r: Raid) => r.slug === raidSlug)
|
||||
setRaid(raid)
|
||||
|
||||
return raid
|
||||
|
|
@ -343,7 +342,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
|||
|
||||
let { raids, sortedRaids } = await api.endpoints.raids
|
||||
.getAll({ params: headers })
|
||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||
.then((response) => organizeRaids(response.data))
|
||||
|
||||
// Extract recency filter
|
||||
const recencyParam: number = parseInt(query.recency)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
|||
|
||||
let { raids, sortedRaids } = await api.endpoints.raids
|
||||
.getAll({ params: headers })
|
||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||
.then((response) => organizeRaids(response.data))
|
||||
|
||||
let jobs = await api.endpoints.jobs
|
||||
.getAll({ params: headers })
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
|||
|
||||
let { raids, sortedRaids } = await api.endpoints.raids
|
||||
.getAll()
|
||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||
.then((response) => organizeRaids(response.data))
|
||||
|
||||
let jobs = await api.endpoints.jobs
|
||||
.getAll({ params: headers })
|
||||
|
|
|
|||
|
|
@ -157,12 +157,11 @@ const SavedRoute: React.FC<Props> = (props: Props) => {
|
|||
// Fetch all raids on mount, then find the raid in the URL if present
|
||||
useEffect(() => {
|
||||
api.endpoints.raids.getAll().then((response) => {
|
||||
const cleanRaids: Raid[] = response.data.map((r: any) => r.raid)
|
||||
setRaids(cleanRaids)
|
||||
setRaids(response.data)
|
||||
|
||||
setRaidsLoading(false)
|
||||
|
||||
const raid = cleanRaids.find((r) => r.slug === raidSlug)
|
||||
const raid = response.data.find((r: Raid) => r.slug === raidSlug)
|
||||
setRaid(raid)
|
||||
|
||||
return raid
|
||||
|
|
@ -348,7 +347,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
|||
|
||||
let { raids, sortedRaids } = await api.endpoints.raids
|
||||
.getAll({ params: headers })
|
||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||
.then((response) => organizeRaids(response.data))
|
||||
|
||||
// Extract recency filter
|
||||
const recencyParam: number = parseInt(query.recency)
|
||||
|
|
|
|||
|
|
@ -157,12 +157,11 @@ const TeamsRoute: React.FC<Props> = (props: Props) => {
|
|||
// Fetch all raids on mount, then find the raid in the URL if present
|
||||
useEffect(() => {
|
||||
api.endpoints.raids.getAll().then((response) => {
|
||||
const cleanRaids: Raid[] = response.data.map((r: any) => r.raid)
|
||||
setRaids(cleanRaids)
|
||||
setRaids(response.data)
|
||||
|
||||
setRaidsLoading(false)
|
||||
|
||||
const raid = cleanRaids.find((r) => r.slug === raidSlug)
|
||||
const raid = response.data.find((r: Raid) => r.slug === raidSlug)
|
||||
setRaid(raid)
|
||||
|
||||
return raid
|
||||
|
|
@ -356,7 +355,7 @@ export const getServerSideProps = async ({ req, res, locale, query }: { req: Nex
|
|||
|
||||
let { raids, sortedRaids } = await api.endpoints.raids
|
||||
.getAll({ params: headers })
|
||||
.then((response) => organizeRaids(response.data.map((r: any) => r.raid)))
|
||||
.then((response) => organizeRaids(response.data))
|
||||
|
||||
// Extract recency filter
|
||||
const recencyParam: number = parseInt(query.recency)
|
||||
|
|
|
|||
Loading…
Reference in a new issue