Skip to content

Instantly share code, notes, and snippets.

@Mattchewone
Created March 9, 2018 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mattchewone/4215286d23bf90fc8131f768253de229 to your computer and use it in GitHub Desktop.
Save Mattchewone/4215286d23bf90fc8131f768253de229 to your computer and use it in GitHub Desktop.
// 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