-
-
Save Mattchewone/4215286d23bf90fc8131f768253de229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hook two | |
module.exports = function () { | |
return async function doSecondThing (context) { | |
const { app, params, data } = context | |
const { namesThatExist } = params | |
const newNames = data.names.filter(name => !namesThatExist.includes(name)) | |
await app.service('service2').create(newNames) | |
return context | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment