Created
January 10, 2019 13:52
-
-
Save PCreations/843dcf0d54154a50d97f82cd37bd7fc7 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
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 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, at line
7
getFooOfID
is called without argumentfooId
.Cheers,
Luca