feat(devices,custom-fields,csat,portal):\n- Editor de campos personalizados (inclui multiselect) e exibição no detalhe\n- Campos personalizados disponíveis nas colunas/templates de exportação\n- Move cópia de e-mail para ícone inline abaixo do nome do dispositivo\n- Portal: banner para avaliar último chamado e CSAT no detalhe\n- Tickets list inclui campos de CSAT para detectar pendências

This commit is contained in:
codex-bot 2025-11-04 14:12:21 -03:00
parent 06deb99bcd
commit c2c5707a97
7 changed files with 299 additions and 14 deletions

View file

@ -5,7 +5,7 @@ import type { Id } from "./_generated/dataModel"
import { requireAdmin, requireUser } from "./rbac"
const FIELD_TYPES = ["text", "number", "select", "date", "boolean"] as const
const FIELD_TYPES = ["text", "number", "select", "multiselect", "date", "boolean"] as const
type FieldType = (typeof FIELD_TYPES)[number]
type AnyCtx = MutationCtx | QueryCtx
@ -31,7 +31,7 @@ async function ensureUniqueKey(ctx: AnyCtx, tenantId: string, key: string, exclu
}
function validateOptions(type: FieldType, options: { value: string; label: string }[] | undefined) {
if (type === "select" && (!options || options.length === 0)) {
if ((type === "select" || type === "multiselect") && (!options || options.length === 0)) {
throw new ConvexError("Campos de seleção precisam de pelo menos uma opção")
}
}