-
-
Save imdongchen/ce0cc566ca1527880a7c0e8dba10a6c4 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
import { rest } from 'msw' | |
rest.post('/', (req, res, ctx) => { | |
if (!isValid(req.body) { | |
return res( | |
ctx.status(400), | |
ctx.json({ error: Invalid request }) | |
) | |
} | |
return res(ctx.status(200)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment