Documentation / @zerotal/orm / index / TransitionResult
Type Alias: TransitionResult
TransitionResult = [
true] | [false,StateError]
Defined in: packages/orm/src/model/State.ts:68
Result of State.transitionTo: [true] on success, or [false, StateError] when the
transition is illegal or a guard blocks it. Destructure and check — TypeScript narrows the
error to StateError in the !ok branch:
const [ok, err] = await order.transitionTo("shipped"); if (!ok) return json({ error: err.message }, 422);