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.
52 lines
1.0 KiB
52 lines
1.0 KiB
import DirectusAbstractStore from './directusAbstract.js'
|
|
|
|
/**
|
|
* Pages from Directus
|
|
*
|
|
* @author Björn Hase <me@herr-hase.wtf>
|
|
* @license http://opensource.org/licenses/MIT The MIT License
|
|
* @link https://gitea.node001.net/HerrHase/super-fastify-directus.git
|
|
*
|
|
*/
|
|
|
|
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',
|
|
'template',
|
|
'meta',
|
|
'content'
|
|
],
|
|
filter: {
|
|
permalink : permalink,
|
|
status : 'published'
|
|
},
|
|
limit: 1
|
|
})
|
|
}
|
|
|
|
}
|
|
|
|
export default PageStore |