Utilizing memoized requests

This commit is contained in:
Linus Flood
2024-10-25 15:33:06 +02:00
parent 4a8d38912f
commit 687a110a39
13 changed files with 123 additions and 91 deletions

View File

@@ -4,7 +4,7 @@ import { z } from "zod"
import { ApiLang } from "@/constants/languages"
import * as api from "@/lib/api"
import { serverClient } from "@/lib/trpc/server"
import { getProfile } from "@/lib/trpc/memoizedRequests"
import { protectedServerActionProcedure } from "@/server/trpc"
import { editProfileSchema } from "@/components/Forms/Edit/Profile/schema"
@@ -68,7 +68,7 @@ export const editProfile = protectedServerActionProcedure
}
}
const profile = await serverClient().user.get()
const profile = await getProfile()
if (!profile || "error" in profile) {
console.error(
"editProfile profile fetch error",