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=>{
|
this.publications.map(row=>{
|
||||||
row.submissions=this.getSubmissionsByPublicationId(row.id)
|
row.submissions=this.getSubmissionsByPublicationId(row.id)
|
||||||
})
|
})
|
||||||
|
this.responses = await this.getResponses()
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
async getStories() {
|
async getStories() {
|
||||||
|
@ -39,6 +40,10 @@ export class Data {
|
||||||
'responses.response'
|
'responses.response'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
async getResponses() {
|
||||||
|
return this.#db('responses')
|
||||||
|
.select('*')
|
||||||
|
}
|
||||||
|
|
||||||
getSubmissionsByStoryId(id){
|
getSubmissionsByStoryId(id){
|
||||||
return this.submissions.filter(row=>row.story_id==id)
|
return this.submissions.filter(row=>row.story_id==id)
|
||||||
|
|
Loading…
Reference in New Issue