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

import DirectusAbstractStore from './directusAbstract.js'
2 years ago
/**
* 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
*
2 years ago
*/
class PageStore extends DirectusAbstractStore {
/**
* init PageStore
*
*
* @param {string} endpoint
*
*/
constructor() {
super('pages')
}
/**
* getting page by permalink
*
2 years ago
*
* @param {string} permalink
* @return {object}
*/
findOneByPermalink(permalink) {
return this.items.readByQuery({
fields: [
'title',
'status',
'permalink',
'template',
2 years ago
'meta',
'content'
],
filter: {
permalink : permalink,
status : 'published'
},
limit: 1
})
}
}
export default PageStore