Skip to content

Instantly share code, notes, and snippets.

@scottgamer
Created March 31, 2022 15:06
Show Gist options
  • Select an option

  • Save scottgamer/bfb40d9a919f916d3dabb68042e46c23 to your computer and use it in GitHub Desktop.

Select an option

Save scottgamer/bfb40d9a919f916d3dabb68042e46c23 to your computer and use it in GitHub Desktop.
get comments request hanlder
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