add responses to data object
This commit is contained in:
parent
8a3f69f6cc
commit
fdcaabe416
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue