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
886 B
48 lines
886 B
2 years ago
|
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 PageStore
|