Skip to content

Commit

Permalink
Fix server translations function
Browse files Browse the repository at this point in the history
  • Loading branch information
RobVermeer committed Nov 29, 2023
1 parent 3873949 commit 2db02c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/users/getUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import { authOptions } from "@/app/[locale]/api/auth/[...nextauth]/route"
import { prisma } from "@/lib/prisma"
import { getServerSession } from "next-auth"
import { useTranslations } from "next-intl"
import { getTranslations } from "next-intl/server"
import { cache } from "react"

export const getUsers = cache(async () => {
const session = await getServerSession(authOptions)
const t = useTranslations("Errors")
const t = await getTranslations("Errors")

if (!session) {
throw new Error(t("notLoggedIn"))
Expand Down

0 comments on commit 2db02c9

Please sign in to comment.