(error: string, status: number, code?: string)
| 10 | const logger = createLogger('WorkflowUtils') |
| 11 | |
| 12 | export function createErrorResponse(error: string, status: number, code?: string) { |
| 13 | return NextResponse.json( |
| 14 | { |
| 15 | error, |
| 16 | code: code || error.toUpperCase().replace(/\s+/g, '_'), |
| 17 | }, |
| 18 | { status } |
| 19 | ) |
| 20 | } |
| 21 | |
| 22 | export function createSuccessResponse(data: any) { |
| 23 | return NextResponse.json(data) |