fix: refactor tracking requests
This commit is contained in:
@@ -12,16 +12,14 @@ import type { LangParams, PageArgs } from "@/types/params"
|
|||||||
export default async function MyPages({
|
export default async function MyPages({
|
||||||
params,
|
params,
|
||||||
}: PageArgs<LangParams & { path: string[] }>) {
|
}: PageArgs<LangParams & { path: string[] }>) {
|
||||||
const accountPage = await serverClient().contentstack.accountPage.get()
|
const accountPageRes = await serverClient().contentstack.accountPage.get()
|
||||||
const { formatMessage } = await getIntl()
|
const { formatMessage } = await getIntl()
|
||||||
|
|
||||||
if (!accountPage) {
|
if (!accountPageRes) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountPageTracking = serverClient().contentstack.accountPage.tracking()
|
const { tracking, accountPage } = accountPageRes
|
||||||
const userTrackingData = serverClient().user.tracking()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className={styles.blocks}>
|
<main className={styles.blocks}>
|
||||||
<Title>{accountPage.heading}</Title>
|
<Title>{accountPage.heading}</Title>
|
||||||
@@ -30,10 +28,7 @@ export default async function MyPages({
|
|||||||
) : (
|
) : (
|
||||||
<p>{formatMessage({ id: "No content published" })}</p>
|
<p>{formatMessage({ id: "No content published" })}</p>
|
||||||
)}
|
)}
|
||||||
<TrackingSDK
|
<TrackingSDK pageData={tracking} />
|
||||||
pageDataPromise={accountPageTracking}
|
|
||||||
userDataPromise={userTrackingData}
|
|
||||||
/>
|
|
||||||
</main>
|
</main>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,13 +5,11 @@ import { serverClient } from "@/lib/trpc/server"
|
|||||||
import TrackingSDK from "@/components/TrackingSDK"
|
import TrackingSDK from "@/components/TrackingSDK"
|
||||||
|
|
||||||
export default async function ProfilePage() {
|
export default async function ProfilePage() {
|
||||||
const accountPageTracking = serverClient().contentstack.accountPage.tracking()
|
const accountPage = await serverClient().contentstack.accountPage.get()
|
||||||
const userTrackingData = serverClient().user.tracking()
|
|
||||||
|
|
||||||
return (
|
if (!accountPage) {
|
||||||
<TrackingSDK
|
return null
|
||||||
pageDataPromise={accountPageTracking}
|
}
|
||||||
userDataPromise={userTrackingData}
|
|
||||||
/>
|
return <TrackingSDK pageData={accountPage.tracking} />
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import TrpcProvider from "@/lib/trpc/Provider"
|
|||||||
import AdobeSDKScript from "@/components/Current/AdobeSDKScript"
|
import AdobeSDKScript from "@/components/Current/AdobeSDKScript"
|
||||||
import Footer from "@/components/Current/Footer"
|
import Footer from "@/components/Current/Footer"
|
||||||
import VwoScript from "@/components/Current/VwoScript"
|
import VwoScript from "@/components/Current/VwoScript"
|
||||||
|
import { preloadUserTracking } from "@/components/TrackingSDK"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
import ServerIntlProvider from "@/i18n/Provider"
|
import ServerIntlProvider from "@/i18n/Provider"
|
||||||
|
|
||||||
@@ -29,6 +30,8 @@ export default async function RootLayout({
|
|||||||
header: React.ReactNode
|
header: React.ReactNode
|
||||||
}
|
}
|
||||||
>) {
|
>) {
|
||||||
|
preloadUserTracking()
|
||||||
|
|
||||||
const { defaultLocale, locale, messages } = await getIntl()
|
const { defaultLocale, locale, messages } = await getIntl()
|
||||||
return (
|
return (
|
||||||
<html lang={params.lang}>
|
<html lang={params.lang}>
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ import styles from "./loyaltyPage.module.css"
|
|||||||
import type { LangParams } from "@/types/params"
|
import type { LangParams } from "@/types/params"
|
||||||
|
|
||||||
export default async function LoyaltyPage({ lang }: LangParams) {
|
export default async function LoyaltyPage({ lang }: LangParams) {
|
||||||
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
|
const loyaltyPageRes = await serverClient().contentstack.loyaltyPage.get()
|
||||||
|
|
||||||
if (!loyaltyPage) {
|
if (!loyaltyPageRes) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const loyaltyPageTracking = serverClient().contentstack.loyaltyPage.tracking()
|
const { tracking, loyaltyPage } = loyaltyPageRes
|
||||||
const userTracking = serverClient().user.tracking()
|
|
||||||
return (
|
return (
|
||||||
<section className={styles.content}>
|
<section className={styles.content}>
|
||||||
{loyaltyPage.sidebar.length ? (
|
{loyaltyPage.sidebar.length ? (
|
||||||
@@ -31,10 +31,7 @@ export default async function LoyaltyPage({ lang }: LangParams) {
|
|||||||
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
||||||
) : null}
|
) : null}
|
||||||
</MaxWidth>
|
</MaxWidth>
|
||||||
<TrackingSDK
|
<TrackingSDK pageData={tracking} />
|
||||||
pageDataPromise={loyaltyPageTracking}
|
|
||||||
userDataPromise={userTracking}
|
|
||||||
/>
|
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,14 +14,13 @@ import styles from "./accountPage.module.css"
|
|||||||
import { LangParams } from "@/types/params"
|
import { LangParams } from "@/types/params"
|
||||||
|
|
||||||
export default async function MyPages({ lang }: LangParams) {
|
export default async function MyPages({ lang }: LangParams) {
|
||||||
const accountPage = await serverClient().contentstack.accountPage.get()
|
const accountPageRes = await serverClient().contentstack.accountPage.get()
|
||||||
|
|
||||||
if (!accountPage) {
|
if (!accountPageRes) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountPageTracking = serverClient().contentstack.accountPage.tracking()
|
const { tracking, accountPage } = accountPageRes
|
||||||
const userTrackingData = serverClient().user.tracking()
|
|
||||||
|
|
||||||
const linkToOverview = `/${lang}/webview${accountPage.url}` !== overview[lang]
|
const linkToOverview = `/${lang}/webview${accountPage.url}` !== overview[lang]
|
||||||
|
|
||||||
@@ -29,10 +28,7 @@ export default async function MyPages({ lang }: LangParams) {
|
|||||||
<MaxWidth className={styles.blocks} tag="main">
|
<MaxWidth className={styles.blocks} tag="main">
|
||||||
{linkToOverview ? <LinkToOverview lang={lang} /> : null}
|
{linkToOverview ? <LinkToOverview lang={lang} /> : null}
|
||||||
<Content lang={lang} content={accountPage.content} />
|
<Content lang={lang} content={accountPage.content} />
|
||||||
<TrackingSDK
|
<TrackingSDK pageData={tracking} />
|
||||||
pageDataPromise={accountPageTracking}
|
|
||||||
userDataPromise={userTrackingData}
|
|
||||||
/>
|
|
||||||
</MaxWidth>
|
</MaxWidth>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,15 +11,13 @@ import styles from "./loyaltyPage.module.css"
|
|||||||
import { LangParams } from "@/types/params"
|
import { LangParams } from "@/types/params"
|
||||||
|
|
||||||
export default async function AboutScandicFriends({ lang }: LangParams) {
|
export default async function AboutScandicFriends({ lang }: LangParams) {
|
||||||
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
|
const loyaltyPageRes = await serverClient().contentstack.loyaltyPage.get()
|
||||||
|
|
||||||
if (!loyaltyPage) {
|
if (!loyaltyPageRes) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const loyaltyPageTracking = serverClient().contentstack.loyaltyPage.tracking()
|
const { tracking, loyaltyPage } = loyaltyPageRes
|
||||||
const userTrackingData = serverClient().user.tracking()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={styles.content}>
|
<section className={styles.content}>
|
||||||
<LinkToOverview lang={lang} />
|
<LinkToOverview lang={lang} />
|
||||||
@@ -27,10 +25,7 @@ export default async function AboutScandicFriends({ lang }: LangParams) {
|
|||||||
<Title>{loyaltyPage.heading}</Title>
|
<Title>{loyaltyPage.heading}</Title>
|
||||||
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
||||||
</MaxWidth>
|
</MaxWidth>
|
||||||
<TrackingSDK
|
<TrackingSDK pageData={tracking} />
|
||||||
pageDataPromise={loyaltyPageTracking}
|
|
||||||
userDataPromise={userTrackingData}
|
|
||||||
/>
|
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|
||||||
import TrackingSDKClient from "./Client"
|
import TrackingSDKClient from "./Client"
|
||||||
|
|
||||||
import { TrackingSDKProps } from "@/types/components/tracking"
|
import { TrackingSDKPageData } from "@/types/components/tracking"
|
||||||
|
|
||||||
|
export const preloadUserTracking = () => {
|
||||||
|
void serverClient().user.tracking()
|
||||||
|
}
|
||||||
|
|
||||||
export default async function TrackingSDK({
|
export default async function TrackingSDK({
|
||||||
pageDataPromise,
|
pageData,
|
||||||
userDataPromise,
|
|
||||||
}: {
|
}: {
|
||||||
pageDataPromise: Promise<TrackingSDKProps["pageData"]>
|
pageData: TrackingSDKPageData
|
||||||
userDataPromise: Promise<TrackingSDKProps["userData"]>
|
|
||||||
}) {
|
}) {
|
||||||
const pageData = await pageDataPromise
|
const userTrackingData = await serverClient().user.tracking()
|
||||||
const userData = await userDataPromise
|
|
||||||
|
|
||||||
return <TrackingSDKClient pageData={pageData} userData={userData} />
|
return <TrackingSDKClient pageData={pageData} userData={userTrackingData} />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ query GetAccountPage($locale: String!, $uid: String!) {
|
|||||||
...AccountPageContentShortcuts
|
...AccountPageContentShortcuts
|
||||||
...AccountPageContentTextContent
|
...AccountPageContentTextContent
|
||||||
}
|
}
|
||||||
|
system {
|
||||||
|
uid
|
||||||
|
created_at
|
||||||
|
updated_at
|
||||||
|
locale
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,15 +105,3 @@ query GetFiNoSvUrlsAccountPage($uid: String!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetTrackingAccountPage($locale: String!, $uid: String!) {
|
|
||||||
account_page(locale: $locale, uid: $uid) {
|
|
||||||
system {
|
|
||||||
locale
|
|
||||||
created_at
|
|
||||||
uid
|
|
||||||
updated_at
|
|
||||||
}
|
|
||||||
title
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ query GetLoyaltyPage($locale: String!, $uid: String!) {
|
|||||||
uid
|
uid
|
||||||
created_at
|
created_at
|
||||||
updated_at
|
updated_at
|
||||||
|
locale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -362,14 +363,3 @@ query GetFiNoSvUrlsLoyaltyPage($uid: String!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetTrackingLoyaltyPage($locale: String!, $uid: String!) {
|
|
||||||
loyalty_page(locale: $locale, uid: $uid) {
|
|
||||||
system {
|
|
||||||
locale
|
|
||||||
created_at
|
|
||||||
uid
|
|
||||||
updated_at
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -125,6 +125,12 @@ export const validateAccountPageSchema = z.object({
|
|||||||
url: z.string(),
|
url: z.string(),
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
content: z.array(accountPageContentItem),
|
content: z.array(accountPageContentItem),
|
||||||
|
system: z.object({
|
||||||
|
uid: z.string(),
|
||||||
|
locale: z.nativeEnum(Lang),
|
||||||
|
created_at: z.string(),
|
||||||
|
updated_at: z.string(),
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -189,18 +195,3 @@ export const validateAccountPageRefsSchema = z.object({
|
|||||||
export type AccountPageRefsDataRaw = z.infer<
|
export type AccountPageRefsDataRaw = z.infer<
|
||||||
typeof validateAccountPageRefsSchema
|
typeof validateAccountPageRefsSchema
|
||||||
>
|
>
|
||||||
|
|
||||||
//Tracking
|
|
||||||
const validateAccountTrackingData = z.object({
|
|
||||||
account_page: z.object({
|
|
||||||
system: z.object({
|
|
||||||
uid: z.string(),
|
|
||||||
locale: z.string(),
|
|
||||||
updated_at: z.string(),
|
|
||||||
created_at: z.string(),
|
|
||||||
}),
|
|
||||||
title: z.string().nullable(),
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
export type AccountPageTackingData = z.infer<typeof validateAccountTrackingData>
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Lang } from "@/constants/languages"
|
|||||||
import {
|
import {
|
||||||
GetAccountPage,
|
GetAccountPage,
|
||||||
GetAccountPageRefs,
|
GetAccountPageRefs,
|
||||||
GetTrackingAccountPage,
|
|
||||||
} from "@/lib/graphql/Query/AccountPage.graphql"
|
} from "@/lib/graphql/Query/AccountPage.graphql"
|
||||||
import { request } from "@/lib/graphql/request"
|
import { request } from "@/lib/graphql/request"
|
||||||
import { notFound } from "@/server/errors/trpc"
|
import { notFound } from "@/server/errors/trpc"
|
||||||
@@ -19,7 +18,6 @@ import {
|
|||||||
type AccountPage,
|
type AccountPage,
|
||||||
AccountPageDataRaw,
|
AccountPageDataRaw,
|
||||||
AccountPageRefsDataRaw,
|
AccountPageRefsDataRaw,
|
||||||
AccountPageTackingData,
|
|
||||||
validateAccountPageRefsSchema,
|
validateAccountPageRefsSchema,
|
||||||
validateAccountPageSchema,
|
validateAccountPageSchema,
|
||||||
} from "./output"
|
} from "./output"
|
||||||
@@ -136,32 +134,18 @@ export const accountPageQueryRouter = router({
|
|||||||
content,
|
content,
|
||||||
} as AccountPage
|
} as AccountPage
|
||||||
|
|
||||||
return accountPage
|
const tracking: TrackingSDKPageData = {
|
||||||
}),
|
pageId: validatedAccountPage.data.account_page.system.uid,
|
||||||
tracking: contentstackExtendedProcedureUID.query(async ({ ctx }) => {
|
lang: validatedAccountPage.data.account_page.system.locale as Lang,
|
||||||
const { lang, uid } = ctx
|
publishedDate: validatedAccountPage.data.account_page.system.updated_at,
|
||||||
|
createdDate: validatedAccountPage.data.account_page.system.created_at,
|
||||||
const response = await request<AccountPageTackingData>(
|
|
||||||
GetTrackingAccountPage,
|
|
||||||
{
|
|
||||||
locale: lang,
|
|
||||||
uid,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!response.data) {
|
|
||||||
throw notFound(response)
|
|
||||||
}
|
|
||||||
|
|
||||||
const accountTrackingData: TrackingSDKPageData = {
|
|
||||||
pageId: response.data.account_page.system.uid,
|
|
||||||
lang: response.data.account_page.system.locale as Lang,
|
|
||||||
publishedDate: response.data.account_page.system.updated_at,
|
|
||||||
createdDate: response.data.account_page.system.created_at,
|
|
||||||
channel: TrackingChannelEnum["scandic-friends"],
|
channel: TrackingChannelEnum["scandic-friends"],
|
||||||
pageType: `member${response.data.account_page.title}page`,
|
pageType: `member${response.data.account_page.title}page`,
|
||||||
}
|
}
|
||||||
|
|
||||||
return accountTrackingData
|
return {
|
||||||
|
accountPage,
|
||||||
|
tracking,
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -193,7 +193,12 @@ export const validateLoyaltyPageSchema = z.object({
|
|||||||
heading: z.string().nullable(),
|
heading: z.string().nullable(),
|
||||||
blocks: z.array(loyaltyPageBlockItem).nullable(),
|
blocks: z.array(loyaltyPageBlockItem).nullable(),
|
||||||
sidebar: z.array(loyaltyPageSidebarItem).nullable(),
|
sidebar: z.array(loyaltyPageSidebarItem).nullable(),
|
||||||
system: z.object({ uid: z.string() }),
|
system: z.object({
|
||||||
|
uid: z.string(),
|
||||||
|
locale: z.nativeEnum(Lang),
|
||||||
|
created_at: z.string(),
|
||||||
|
updated_at: z.string(),
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
// Block types
|
// Block types
|
||||||
@@ -417,17 +422,3 @@ export const validateLoyaltyPageRefsSchema = z.object({
|
|||||||
export type LoyaltyPageRefsDataRaw = z.infer<
|
export type LoyaltyPageRefsDataRaw = z.infer<
|
||||||
typeof validateLoyaltyPageRefsSchema
|
typeof validateLoyaltyPageRefsSchema
|
||||||
>
|
>
|
||||||
|
|
||||||
//Tracking
|
|
||||||
const validateLoyaltyTrackingData = z.object({
|
|
||||||
loyalty_page: z.object({
|
|
||||||
system: z.object({
|
|
||||||
uid: z.string(),
|
|
||||||
locale: z.string(),
|
|
||||||
updated_at: z.string(),
|
|
||||||
created_at: z.string(),
|
|
||||||
}),
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
export type LoyaltyPageTackingData = z.infer<typeof validateLoyaltyTrackingData>
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Lang } from "@/constants/languages"
|
|||||||
import {
|
import {
|
||||||
GetLoyaltyPage,
|
GetLoyaltyPage,
|
||||||
GetLoyaltyPageRefs,
|
GetLoyaltyPageRefs,
|
||||||
GetTrackingLoyaltyPage,
|
|
||||||
} from "@/lib/graphql/Query/LoyaltyPage.graphql"
|
} from "@/lib/graphql/Query/LoyaltyPage.graphql"
|
||||||
import { request } from "@/lib/graphql/request"
|
import { request } from "@/lib/graphql/request"
|
||||||
import { notFound } from "@/server/errors/trpc"
|
import { notFound } from "@/server/errors/trpc"
|
||||||
@@ -20,7 +19,6 @@ import { removeEmptyObjects } from "../../utils"
|
|||||||
import {
|
import {
|
||||||
LoyaltyPage,
|
LoyaltyPage,
|
||||||
type LoyaltyPageRefsDataRaw,
|
type LoyaltyPageRefsDataRaw,
|
||||||
LoyaltyPageTackingData,
|
|
||||||
validateLoyaltyPageRefsSchema,
|
validateLoyaltyPageRefsSchema,
|
||||||
validateLoyaltyPageSchema,
|
validateLoyaltyPageSchema,
|
||||||
} from "./output"
|
} from "./output"
|
||||||
@@ -228,24 +226,6 @@ export const loyaltyPageQueryRouter = router({
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert LoyaltyPage type to get correct typings for RTE fields
|
|
||||||
return validatedLoyaltyPage.data as LoyaltyPage
|
|
||||||
}),
|
|
||||||
tracking: contentstackExtendedProcedureUID.query(async ({ ctx }) => {
|
|
||||||
const { lang, uid } = ctx
|
|
||||||
|
|
||||||
const response = await request<LoyaltyPageTackingData>(
|
|
||||||
GetTrackingLoyaltyPage,
|
|
||||||
{
|
|
||||||
locale: lang,
|
|
||||||
uid,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!response.data) {
|
|
||||||
throw notFound(response)
|
|
||||||
}
|
|
||||||
|
|
||||||
const loyaltyTrackingData: TrackingSDKPageData = {
|
const loyaltyTrackingData: TrackingSDKPageData = {
|
||||||
pageId: response.data.loyalty_page.system.uid,
|
pageId: response.data.loyalty_page.system.uid,
|
||||||
lang: response.data.loyalty_page.system.locale as Lang,
|
lang: response.data.loyalty_page.system.locale as Lang,
|
||||||
@@ -255,6 +235,10 @@ export const loyaltyPageQueryRouter = router({
|
|||||||
pageType: "loyaltycontentpage",
|
pageType: "loyaltycontentpage",
|
||||||
}
|
}
|
||||||
|
|
||||||
return loyaltyTrackingData
|
// Assert LoyaltyPage type to get correct typings for RTE fields
|
||||||
|
return {
|
||||||
|
loyaltyPage: validatedLoyaltyPage.data as LoyaltyPage,
|
||||||
|
tracking: loyaltyTrackingData,
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -248,18 +248,9 @@ export const userQueryRouter = router({
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (!previousStaysResponse.ok) {
|
if (!previousStaysResponse.ok) {
|
||||||
// switch (apiResponse.status) {
|
console.info(
|
||||||
// case 400:
|
`API Response Failed - Getting Previous Stays for tracking user`
|
||||||
// throw badRequestError(apiResponse)
|
)
|
||||||
// case 401:
|
|
||||||
// throw unauthorizedError(apiResponse)
|
|
||||||
// case 403:
|
|
||||||
// throw forbiddenError(apiResponse)
|
|
||||||
// default:
|
|
||||||
// throw internalServerError(apiResponse)
|
|
||||||
// }
|
|
||||||
console.info(`API Response Failed - Getting Previous Stays`)
|
|
||||||
console.info(`User: (${JSON.stringify(ctx.session.user)})`)
|
|
||||||
console.error(previousStaysResponse)
|
console.error(previousStaysResponse)
|
||||||
return notLoggedInUserTrackingData
|
return notLoggedInUserTrackingData
|
||||||
}
|
}
|
||||||
@@ -268,8 +259,7 @@ export const userQueryRouter = router({
|
|||||||
const verifiedPreviousStaysData =
|
const verifiedPreviousStaysData =
|
||||||
getStaysSchema.safeParse(previousStaysApiJson)
|
getStaysSchema.safeParse(previousStaysApiJson)
|
||||||
if (!verifiedPreviousStaysData.success) {
|
if (!verifiedPreviousStaysData.success) {
|
||||||
console.info(`Failed to validate Previous Stays Data`)
|
console.info(`Failed to validate Previous Stays Data for tracking user`)
|
||||||
console.info(`User: (${JSON.stringify(ctx.session.user)})`)
|
|
||||||
console.error(verifiedPreviousStaysData.error)
|
console.error(verifiedPreviousStaysData.error)
|
||||||
return notLoggedInUserTrackingData
|
return notLoggedInUserTrackingData
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user