fix: add args as keyParts for unstable_cache

This commit is contained in:
Christel Westerberg
2024-10-09 11:27:16 +02:00
committed by Pontus Dreij
parent ea8fdc940d
commit ed3acce57c
7 changed files with 204 additions and 186 deletions
+2 -6
View File
@@ -11,16 +11,12 @@ import {
unauthorizedError,
} from "./errors/trpc"
import { type Context, createContext } from "./context"
import { fetchServiceToken } from "./tokenManager"
import { getServiceToken } from "./tokenManager"
import { transformer } from "./transformer"
import { langInput } from "./utils"
import type { Session } from "next-auth"
import {
ServiceTokenScope,
ServiceTokenScopeEnum,
} from "@/types/enums/serviceToken"
import type { Meta } from "@/types/trpc/meta"
const t = initTRPC
@@ -126,7 +122,7 @@ export const safeProtectedProcedure = t.procedure.use(async function (opts) {
})
export const serviceProcedure = t.procedure.use(async (opts) => {
const { access_token } = await fetchServiceToken()
const { access_token } = await getServiceToken()
if (!access_token) {
throw internalServerError(`Failed to obtain service token`)
}