Last active
May 15, 2017 12:43
-
-
Save aherve/8de45d266dfed64f0005b703f0693b09 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const wrappedShowUser = apiMethod<{user?: User}>(async req => { | |
const user = await User.findOne({id: req.params.id}) | |
if (!user) {return {statusCode: 404}} | |
return { | |
statusCode: 200, | |
data: {user}, | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment