import { assertOwnTenant } from '@voltro/plugin-multitenancy/guard' import type { AppContext } from '@voltro/runtime' const execute = async ( input: { tenantId: string; title: string; body: string; tag: string }, ctx: AppContext, ) => { assertOwnTenant(input.tenantId, ctx.request.subject) // The framework auto-injects an `art_…` id. The insert commits, then the // search plugin's tap indexes it — nothing to do here for search. return ctx.store.insert('articles', { title: input.title, body: input.body, tag: input.tag, tenantId: input.tenantId, }) } export default execute