Skip to content

Commit 95df124

Browse files
committed
fix: use Prisma.JsonNull for clearing flags, fix enum display showing __unset__
1 parent 4b6b4d2 commit 95df124

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

apps/webapp/app/components/admin/FeatureFlagsDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ function EnumControl({
278278
value={value ?? "__unset__"}
279279
setValue={onChange}
280280
items={items}
281+
text={(val) => (val === "__unset__" ? "unset" : val)}
281282
className={cn(dimmed && "opacity-50")}
282283
>
283284
{(items) =>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/server-runtime";
22
import { json } from "@remix-run/server-runtime";
3+
import { Prisma } from "@trigger.dev/database";
34
import { z } from "zod";
45
import { prisma } from "~/db.server";
56
import { requireUser } from "~/services/session.server";
@@ -78,7 +79,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
7879
if (body === null || (typeof body === "object" && Object.keys(body).length === 0)) {
7980
await prisma.organization.update({
8081
where: { id: orgId },
81-
data: { featureFlags: null },
82+
data: { featureFlags: Prisma.JsonNull },
8283
});
8384
return json({ success: true });
8485
}

0 commit comments

Comments
 (0)