fix: Detect types also for not paginated arrays

This commit is contained in:
Faruk AYDIN
2024-02-19 21:46:20 +01:00
parent a445538e81
commit 2d6d2430d2

View File

@@ -15,6 +15,8 @@ const renderObject = (response, object) => {
let data = isPaginated(object) ? object.records : object;
const type = isPaginated(object)
? object.records[0].constructor.name
: Array.isArray(object)
? object[0].constructor.name
: object.constructor.name;
const serializer = serializers[type];