You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
889 B

import DirectusAbstractStore from './directusAbstract.js'
/**
* Comments
*
*
*/
class CommentStore extends DirectusAbstractStore {
/**
*
*
* @param {string} endpoint
*
*/
constructor() {
super('comments')
}
/**
* getting page by permalink
*
* @param {string} permalink
* @return {object}
*/
find(page, uuid, limit = 20) {
return this.items.readByQuery({
fields: [
'name',
'content',
'approved',
'belongs_to.comments_id'
],
filter: {
approved : true,
belongs_to : {
comments_id: uuid
}
},
limit : limit,
offset : ((page - 1) * limit)
})
}
}
export default CommentStore