Skip to content

Commit 67dd8b8

Browse files
committed
fix: replace findUnique with findFirst in v1 org feature flags route
1 parent 6af67a9 commit 67dd8b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/webapp/app/routes/admin.api.v1.orgs.$organizationId.feature-flags.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function authenticateAdmin(request: Request) {
1515
return { error: json({ error: "Invalid or Missing API key" }, { status: 401 }) };
1616
}
1717

18-
const user = await prisma.user.findUnique({
18+
const user = await prisma.user.findFirst({
1919
where: {
2020
id: authenticationResult.userId,
2121
},
@@ -41,7 +41,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
4141

4242
const { organizationId } = ParamsSchema.parse(params);
4343

44-
const organization = await prisma.organization.findUnique({
44+
const organization = await prisma.organization.findFirst({
4545
where: {
4646
id: organizationId,
4747
},
@@ -78,7 +78,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
7878

7979
const { organizationId } = ParamsSchema.parse(params);
8080

81-
const organization = await prisma.organization.findUnique({
81+
const organization = await prisma.organization.findFirst({
8282
where: {
8383
id: organizationId,
8484
},

0 commit comments

Comments
 (0)