Skip to content

Commit e949ea0

Browse files
committed
Return fully populated records for all models
1 parent 8b9bf16 commit e949ea0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

server/src/generic-controller.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,10 @@ export class GenericController {
349349

350350
console.log("Found records:", records.length);
351351

352-
if (modelName == "papers") {
353-
console.log("AAAAAAAA");
354-
return Promise.all(
355-
records.map((r) => this.getFullPaperById(r.getDataValue("id"))),
356-
);
357-
}
358-
359-
return records.map((r) => r.get({ plain: true }));
352+
// Return fully populated records for all models
353+
return Promise.all(
354+
records.map((r) => this.getById(modelName, r.getDataValue("id"))),
355+
);
360356
}
361357

362358
/** Create full paper along with related entities */

0 commit comments

Comments
 (0)