Created
March 31, 2022 15:06
-
-
Save scottgamer/bfb40d9a919f916d3dabb68042e46c23 to your computer and use it in GitHub Desktop.
get comments request hanlder
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
| function getComments() { | |
| return rest.get(`${CONSTANTS.API_URL}/comments`, (req, res, ctx) => { | |
| return res( | |
| ctx.status(200), | |
| ctx.json([ | |
| { | |
| id: 1, | |
| name: "Comment name 1", | |
| email: "richosojason@msn.com", | |
| body: "Comment body 2", | |
| }, | |
| { | |
| id: 2, | |
| name: "Comment name 2", | |
| email: "rmunoz@stackbuilders.com", | |
| body: "Comment body 2", | |
| }, | |
| ]) | |
| ); | |
| }); | |
| } | |
| export const handlers = [getPosts(), getComments()]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment