fix admin save state architecture
This commit is contained in:
@@ -14,6 +14,7 @@ import { getLocalizedPath } from "@/lib/locale";
|
||||
import { removeManagedMediaFile } from "@/lib/media-storage";
|
||||
import { mediaFieldInputSchema } from "@/lib/media-validation";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { isCheckedFormValue } from "@/lib/form-data";
|
||||
import {
|
||||
assetInputSchema,
|
||||
categoryInputSchema,
|
||||
@@ -40,7 +41,7 @@ function withMessage(pathname: string, type: "success" | "error", message: strin
|
||||
}
|
||||
|
||||
function normalizeCheckboxValue(formData: FormData, key: string) {
|
||||
return formData.get(key) === "on";
|
||||
return isCheckedFormValue(formData.get(key));
|
||||
}
|
||||
|
||||
function parseJsonArray(rawValue: FormDataEntryValue | null, key: string) {
|
||||
|
||||
Reference in New Issue
Block a user