fix: install clean-deep

This commit is contained in:
Christel Westerberg
2024-05-15 13:20:43 +02:00
parent 863d99ad44
commit cd33e17775
6 changed files with 55 additions and 27 deletions

View File

@@ -6,13 +6,13 @@ import { request } from "@/lib/graphql/request"
import { badRequestError, internalServerError } from "@/server/errors/trpc"
import { publicProcedure, router } from "@/server/trpc"
import { removeEmptyObjects } from "@/utils/contentType"
import {
generateRefsResponseTag,
generateTag,
generateTags,
} from "@/utils/generateTag"
import { removeEmptyObjects } from "../../utils"
import { getAccountPageInput } from "./input"
import {
type AccountPage,
@@ -51,6 +51,9 @@ export const accountPageQueryRouter = router({
throw internalServerError()
}
// Remove empty objects from a fetched content type. Needed since
// Contentstack returns empty objects for all non queried blocks in modular blocks.
// This is an ongoing support case in Contentstack, ticker number #00031579
const cleanedData = removeEmptyObjects(refsResponse.data)
const validatedAccountPageRefs =
@@ -71,7 +74,7 @@ export const accountPageQueryRouter = router({
validatedAccountPageRefs.data.all_account_page.items[0].system.uid
)
)
const response = await request<AccountPage>(
const response = await request<AccountPageRefsDataRaw>(
GetAccountPage,
{
locale: lang,

View File

@@ -7,13 +7,13 @@ import { _ } from "@/lib/translation"
import { badRequestError, internalServerError } from "@/server/errors/trpc"
import { publicProcedure, router } from "@/server/trpc"
import { removeEmptyObjects } from "@/utils/contentType"
import {
generateRefsResponseTag,
generateTag,
generateTags,
} from "@/utils/generateTag"
import { removeEmptyObjects } from "../../utils"
import { getLoyaltyPageInput } from "./input"
import {
type LoyaltyPage,
@@ -56,6 +56,9 @@ export const loyaltyPageQueryRouter = router({
throw internalServerError()
}
// Remove empty objects from a fetched content type. Needed since
// Contentstack returns empty objects for all non queried blocks in modular blocks.
// This is an ongoing support case in Contentstack, ticker number #00031579
const cleanedData = removeEmptyObjects(refsResponse.data)
const validatedLoyaltyPageRefs =