diff --git a/server/presenters/collection.ts b/server/presenters/collection.ts index a643f2bd0..2e634fc7f 100644 --- a/server/presenters/collection.ts +++ b/server/presenters/collection.ts @@ -18,7 +18,7 @@ export default function present(collection: Collection) { createdAt: collection.createdAt, updatedAt: collection.updatedAt, deletedAt: collection.deletedAt, - documents: collection.documentStructure || [], + documents: collection.documentStructure, }; // Handle the "sort" field being empty here for backwards compatability @@ -29,7 +29,10 @@ export default function present(collection: Collection) { }; } - data.documents = sortNavigationNodes(collection.documentStructure, data.sort); + data.documents = sortNavigationNodes( + collection.documentStructure || [], + data.sort + ); return data; }