Merged in feat/SW-1442-destination-overview-page (pull request #1188)

feat(SW-1442): added destination overview page

* feat(SW-1442): added destination overview page


Approved-by: Fredrik Thorsson
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-01-20 12:21:04 +00:00
parent 814b010569
commit 7ac200bd7c
27 changed files with 526 additions and 16 deletions

View File

@@ -1,23 +1,25 @@
import { Lang } from "@/constants/languages"
import { edgeRequest } from "@/lib/graphql/edgeRequest"
import { ResolveEntryByUrl } from "@/lib/graphql/Query/ResolveEntry.graphql"
import { batchEdgeRequest } from "@/lib/graphql/batchEdgeRequest"
import {
EntryByUrlBatch1,
EntryByUrlBatch2,
} from "@/lib/graphql/Query/ResolveEntry.graphql"
import { internalServerError } from "@/server/errors/next"
import { validateEntryResolveSchema } from "@/types/requests/entry"
export async function resolve(url: string, lang = Lang.en) {
const response = await edgeRequest(
ResolveEntryByUrl,
const variables = { locale: lang, url }
const response = await batchEdgeRequest([
{
locale: lang,
url,
document: EntryByUrlBatch1,
variables,
},
{
next: {
revalidate: 3600,
},
}
)
document: EntryByUrlBatch2,
variables,
},
])
const validatedData = validateEntryResolveSchema.safeParse(response.data)