Spaces:
Build error
Build error
File size: 454 Bytes
0bfe2e3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import { createLogger } from '@aiostreams/core';
const logger = createLogger('server');
type ApiResponseOptions = {
success: boolean;
detail?: string;
data?: any;
error?: {
code: string;
message: string;
};
};
export function createResponse(options: ApiResponseOptions) {
const { success, detail, data, error } = options;
return {
success,
detail: detail || null,
data: data || null,
error: error || null,
};
}
|