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
842 B

2 years ago
import DirectusAbstractStore from './DirectusAbstract.js'
/**
* Pages from Directus
*
*
*/
class PageStore extends DirectusAbstractStore {
/**
* init PageStore
*
*
* @param {string} endpoint
*
*/
constructor() {
super('pages')
}
/**
* getting page by permalink
*
*
* @param {string} permalink
* @return {object}
*/
findOneByPermalink(permalink) {
return this.items.readByQuery({
fields: [
'title',
'status',
'permalink',
'meta',
'content'
],
filter: {
permalink : permalink,
status : 'published'
},
limit: 1
})
}
}
export default PageStore