"use server"; import { z } from "zod"; import { contentMutationService } from "@/features/housekeeping/domains/content/services/mutations"; import { PERMS } from "@/lib/permissions"; import { adminAction } from "@/lib/safe-action"; import { actionOk } from "@/lib/safe-action-shared"; const saveEmulatorSettingsSchema = z.object({ settings: z.record(z.string(), z.string()), }); export const saveEmulatorSettings = adminAction( { permission: PERMS.SETTINGS_EDIT, schema: saveEmulatorSettingsSchema }, async (ctx) => { const result = await contentMutationService.execute( { correlationId: String(ctx.requestId), expectedActorId: Number(ctx.session.user.id), legacy: true, }, "translation.emulator.save", ctx.data, ); if (!result.ok) throw new Error(result.error.messageKey); return actionOk(); }, );