fix(convex): use ctx.runMutation(api.tickets.create) instead of importing handler to satisfy types and build
This commit is contained in:
parent
335accb596
commit
e682c6773a
1 changed files with 15 additions and 16 deletions
|
|
@ -1,5 +1,6 @@
|
|||
// ci: trigger convex functions deploy
|
||||
import { mutation, query } from "./_generated/server"
|
||||
import { api } from "./_generated/api"
|
||||
import { ConvexError, v } from "convex/values"
|
||||
import { sha256 } from "@noble/hashes/sha256"
|
||||
import { randomBytes } from "@noble/hashes/utils"
|
||||
|
|
@ -146,9 +147,7 @@ async function createTicketForAlert(
|
|||
if (!subcategory) return null
|
||||
|
||||
try {
|
||||
const id = await (await import("./tickets"))
|
||||
.create
|
||||
.handler(ctx as any, {
|
||||
const id = await ctx.runMutation(api.tickets.create, {
|
||||
actorId: actor._id,
|
||||
tenantId,
|
||||
subject,
|
||||
|
|
@ -161,7 +160,7 @@ async function createTicketForAlert(
|
|||
categoryId: category._id,
|
||||
subcategoryId: subcategory._id,
|
||||
customFields: undefined,
|
||||
} as any)
|
||||
})
|
||||
return id
|
||||
} catch (error) {
|
||||
console.error("[machines.alerts] Falha ao criar ticket:", error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue