Update Full Example

Pass { schema: req.schema } as a second argument
This commit is contained in:
Dugi
2020-12-30 11:49:36 +02:00
committed by GitHub
parent 4b14249c6b
commit f44f3ca490

View File

@@ -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))