fix: cache with duplicated data

This commit is contained in:
Divlo
2022-08-30 21:30:06 +02:00
parent 3d185bf044
commit a068d31d14
22 changed files with 98 additions and 95 deletions

View File

@ -68,10 +68,7 @@ export const getServerSideProps = authenticationFromServerSide({
const guildId = Number(context?.params?.guildId)
if (isNaN(channelId) || isNaN(guildId)) {
return {
redirect: {
destination: '/404',
permanent: false
}
notFound: true
}
}
const { data: guildMember } = await api.get(`/guilds/${guildId}`)

View File

@ -63,10 +63,7 @@ export const getServerSideProps = authenticationFromServerSide({
const guildId = Number(context?.params?.guildId)
if (isNaN(channelId) || isNaN(guildId)) {
return {
redirect: {
destination: '/404',
permanent: false
}
notFound: true
}
}
const { data: guildMember } = await api.get<GuildMember>(
@ -74,10 +71,7 @@ export const getServerSideProps = authenticationFromServerSide({
)
if (!guildMember.member.isOwner) {
return {
redirect: {
destination: '/404',
permanent: false
}
notFound: true
}
}
const { data: selectedChannelData } = await api.get(

View File

@ -49,10 +49,7 @@ export const getServerSideProps = authenticationFromServerSide({
const guildId = Number(context?.params?.guildId)
if (isNaN(guildId)) {
return {
redirect: {
destination: '/404',
permanent: false
}
notFound: true
}
}
const { data: guildMember } = await api.get(`/guilds/${guildId}`)

View File

@ -43,10 +43,7 @@ export const getServerSideProps = authenticationFromServerSide({
const guildId = Number(context?.params?.guildId)
if (isNaN(guildId)) {
return {
redirect: {
destination: '/404',
permanent: false
}
notFound: true
}
}
const { data: guildMember } = await api.get<GuildMember>(