Skip to content

Instantly share code, notes, and snippets.

@PCreations
Created January 10, 2019 13:52
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 PCreations/843dcf0d54154a50d97f82cd37bd7fc7 to your computer and use it in GitHub Desktop.
Save PCreations/843dcf0d54154a50d97f82cd37bd7fc7 to your computer and use it in GitHub Desktop.
const { updateBar } = require('../domain/foo/behaviors');
const updateBarUseCaseHandler = ({ getFooOfId, saveFoo }) => async ({ fooId, bar }) => {
if (typeof fooId !== typeof '') {
throw new Error('fooId must be string');
}
const fooData = getFooOfId();
const newFooData = updateBar({ fooData, bar });
await saveFoo(newFooData);
}
module.exports = {
updateBarUseCaseHandler
}
@theliuk
Copy link

theliuk commented Nov 10, 2023

Hi, at line 7 getFooOfID is called without argument fooId.

Cheers,

Luca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment