Update api-hooks.md

This commit is contained in:
Rijk van Zanten
2020-10-05 15:13:28 -04:00
committed by GitHub
parent 720ed532d5
commit 2d9f911be1

View File

@@ -134,8 +134,8 @@ module.exports = function registerHook({ services, exceptions }) {
if (accountability.admin !== true) throw new ForbiddenException();
},
// Sync with external recipes service, cancel creation on failure
'items.create.before': async function(input) {
if (input.collection !== 'recipes') return input;
'items.create.before': async function(input, { collection }) {
if (collection !== 'recipes') return input;
try {
await axios.post('https://example.com/recipes', input);