feat: get breakfast package from API

This commit is contained in:
Simon Emanuelsson
2024-10-28 10:12:03 +01:00
parent fc8844eb96
commit 62f549e85d
47 changed files with 718 additions and 210 deletions

View File

@@ -1,5 +1,6 @@
import { cookies, headers } from "next/headers"
import { type Session } from "next-auth"
import { cache } from "react"
import { Lang } from "@/constants/languages"
@@ -37,7 +38,7 @@ export function createContextInner(opts: CreateContextOptions) {
* This is the actual context you'll use in your router
* @link https://trpc.io/docs/context
**/
export function createContext() {
export const createContext = cache(function () {
const h = headers()
const cookie = cookies()
@@ -66,6 +67,6 @@ export function createContext() {
webToken: webviewTokenCookie?.value,
contentType: h.get("x-contenttype")!,
})
}
})
export type Context = ReturnType<typeof createContext>