fix: criação de template de checklist
- Permite isArchived na mutation checklistTemplates.create\n- Troca Select por SearchableCombobox no campo Empresa
This commit is contained in:
parent
8a045c0131
commit
51c9cab79c
2 changed files with 23 additions and 16 deletions
|
|
@ -167,8 +167,9 @@ export const create = mutation({
|
|||
required: v.optional(v.boolean()),
|
||||
}),
|
||||
),
|
||||
isArchived: v.optional(v.boolean()),
|
||||
},
|
||||
handler: async (ctx, { tenantId, actorId, name, description, companyId, items }) => {
|
||||
handler: async (ctx, { tenantId, actorId, name, description, companyId, items, isArchived }) => {
|
||||
await requireAdmin(ctx, actorId, tenantId)
|
||||
|
||||
const normalizedName = normalizeTemplateName(name)
|
||||
|
|
@ -185,6 +186,7 @@ export const create = mutation({
|
|||
|
||||
const normalizedItems = normalizeTemplateItems(items, {})
|
||||
const normalizedDescription = normalizeTemplateDescription(description)
|
||||
const archivedFlag = typeof isArchived === "boolean" ? isArchived : false
|
||||
const now = Date.now()
|
||||
|
||||
return ctx.db.insert("ticketChecklistTemplates", {
|
||||
|
|
@ -193,7 +195,7 @@ export const create = mutation({
|
|||
description: normalizedDescription ?? undefined,
|
||||
companyId: companyId ?? undefined,
|
||||
items: normalizedItems,
|
||||
isArchived: false,
|
||||
isArchived: archivedFlag,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
createdBy: actorId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue