export const getServerSideProps = async (context: any) => {
const session = await getSession(context)
const { id: shopId } = context.query
const shop = trpc.shops.getById.useQuery(shopId)
if (!shop) {
return {
redirect: {
permanent: false,
destination: `api/auth/signin`,
},
}
}
export const getServerSideProps = async (context: any) => {
const session = await getSession(context)
const { id: shopId } = context.query
const shop = trpc.shops.getById.useQuery(shopId)
if (!shop) {
return {
redirect: {
permanent: false,
destination: `api/auth/signin`,
},
}
}