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 { isArray } from 'lodash';
export class ErrorResponse extends Response {
//@ts-ignore
@@ -41,9 +42,11 @@ export class OkResponse extends Response {
constructor(body?: Model | null) {
if (body) {
return Response.json(
{
...body,
},
isArray(body)
? body
: {
...body,
},
{
status: 200,
headers: {