mirror of
https://github.com/directus/directus.git
synced 2026-01-23 09:38:03 -05:00
Update Full Example
Pass { schema: req.schema } as a second argument
This commit is contained in:
@@ -61,9 +61,8 @@ module.exports = function registerEndpoint(router, { services, exceptions }) {
|
||||
const { ItemsService } = services;
|
||||
const { ServiceUnavailableException } = exceptions;
|
||||
|
||||
const recipeService = new ItemsService('recipes');
|
||||
|
||||
router.get('/', (req, res) => {
|
||||
const recipeService = new ItemsService('recipes', { schema: req.schema });
|
||||
recipeService
|
||||
.readByQuery({ sort: 'name', fields: '*' })
|
||||
.then((results) => res.json(results))
|
||||
|
||||
Reference in New Issue
Block a user