mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Update api-hooks.md
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user