api / src /status.js
Tataaicoltd's picture
deploy: taboard API (overwrite)
30a3fac verified
Raw History Blame Contribute Delete
333 Bytes
// Shared ticket status mapping. DB stores status as an int; APIs use labels.
// Index in STATUSES = the stored integer value.
export const STATUSES = ['open', 'queued', 'processing', 'done', 'failed', 'close'];
export const statusToInt = (label) => STATUSES.indexOf(label);
export const intToStatus = (n) => STATUSES[n] ?? 'open';