Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 committed Sep 5, 2023
1 parent dd8b2f4 commit e0527b2
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions client/src/mocks/stub-new-work/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ export const mockApplicationArray: Application[] = [
];

export const handlers = [
rest.get(AppRest.APPLICATIONS, (req, res, ctx) => {
return res(ctx.json(mockApplicationArray));
}),
rest.get(`${AppRest.APPLICATIONS}/:id`, (req, res, ctx) => {
const { id } = req.params;
const mockApplication = mockApplicationArray.find(
(app) => app.id === parseInt(id as string, 10)
);

if (mockApplication) {
return res(ctx.json(mockApplication));
} else {
return res(
ctx.status(404),
ctx.json({ message: "Application not found" })
);
}
}),
// Commented out to avoid conflict with the real API
// rest.get(AppRest.APPLICATIONS, (req, res, ctx) => {
// return res(ctx.json(mockApplicationArray));
// }),
// rest.get(`${AppRest.APPLICATIONS}/:id`, (req, res, ctx) => {
// const { id } = req.params;
// const mockApplication = mockApplicationArray.find(
// (app) => app.id === parseInt(id as string, 10)
// );
// if (mockApplication) {
// return res(ctx.json(mockApplication));
// } else {
// return res(
// ctx.status(404),
// ctx.json({ message: "Application not found" })
// );
// }
// }),
];

export default handlers;

0 comments on commit e0527b2

Please sign in to comment.