From 2a6a2a6def57dcf3870f549037041b75cc2c5235 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Tue, 4 Apr 2023 12:04:58 +0200 Subject: [PATCH] - oder authors and contributor inside dataset.controller.ts - npm updates --- src/controllers/dataset.controller.ts | 6 ++++++ src/models/init-models.js | 1 + 2 files changed, 7 insertions(+) diff --git a/src/controllers/dataset.controller.ts b/src/controllers/dataset.controller.ts index 92f0eef..e76b1e7 100644 --- a/src/controllers/dataset.controller.ts +++ b/src/controllers/dataset.controller.ts @@ -48,6 +48,7 @@ export class DatasetController { model: Person, through: { where: { role: "author" } }, as: "authors", + // order: [['link_documents_persons.sort_order', 'ASC']], }, { model: Person, @@ -61,6 +62,11 @@ export class DatasetController { "files", "identifier", ], + order: [ + ["authors", dbContext.DocumentPersons, "sort_order", "ASC"], + ["contributors", dbContext.DocumentPersons, "sort_order", "ASC"], + ], + // order: ['server_date_published'], // order: ['server_date_published'], }); // .then((data) => { diff --git a/src/models/init-models.js b/src/models/init-models.js index fb73d37..1aeb83e 100644 --- a/src/models/init-models.js +++ b/src/models/init-models.js @@ -255,5 +255,6 @@ export function initModels() { Coverage: Coverage, Subject: Subject, License: License, + DocumentPersons: DocumentPersons }; }