From fdcaabe4164df2b1a4788d90503e42fecee30fac Mon Sep 17 00:00:00 2001 From: Andrzej Stepien Date: Tue, 12 Sep 2023 00:00:09 +0200 Subject: [PATCH] add responses to data object --- objects/Data.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/objects/Data.mjs b/objects/Data.mjs index 991bca1..235229e 100644 --- a/objects/Data.mjs +++ b/objects/Data.mjs @@ -13,6 +13,7 @@ export class Data { this.publications.map(row=>{ row.submissions=this.getSubmissionsByPublicationId(row.id) }) + this.responses = await this.getResponses() return this } async getStories() { @@ -39,6 +40,10 @@ export class Data { 'responses.response' ) } + async getResponses() { + return this.#db('responses') + .select('*') + } getSubmissionsByStoryId(id){ return this.submissions.filter(row=>row.story_id==id)