#409 Error code conflict
8 messages · Page 1 of 1 (latest)
this.router.patch(
'/',
this.authenticator.isLoggedIn,
this.authenticator.isCustomer,
(req: any, res: any, next: any) =>
this.controller
.checkoutCart(req.user)
.then(() => res.status(200).end())
.catch(err => {
next(err);
}),
);
the get router
this.router.get(
'/',
this.authenticator.isLoggedIn,
this.authenticator.isCustomer,
(req: any, res: any, next: any) =>
this.controller
.getCart(req.user)
.then((cart: Cart) => {
res.status(200).json(cart);
})
.catch(err => {
next(err);
}),
);
and the test:
describe("PATCH /carts", () => {
test("checking out the current cart, expecting code 200", async () => {
await request(app)
.patch(routePath+'/carts')
.set("Cookie", customerCookie)
.expect(200)
})
})
Nope that is fine
409 looks like an error code returned by some code, so I would look at your middlewares