Fixed an issue with how responses were handled making arrays into objects.

This commit is contained in:
jd
2026-02-18 21:59:46 +00:00
parent 0f6452fdd4
commit 4a63f0507d

View File

@@ -1,4 +1,5 @@
import { BadRequestError, NotFoundError, UnauthorizedError } from './errors'; import { BadRequestError, NotFoundError, UnauthorizedError } from './errors';
import { isArray } from 'lodash';
export class ErrorResponse extends Response { export class ErrorResponse extends Response {
//@ts-ignore //@ts-ignore
@@ -41,9 +42,11 @@ export class OkResponse extends Response {
constructor(body?: Model | null) { constructor(body?: Model | null) {
if (body) { if (body) {
return Response.json( return Response.json(
{ isArray(body)
...body, ? body
}, : {
...body,
},
{ {
status: 200, status: 200,
headers: { headers: {