diff --git a/src/controllers/items/getItems.ts b/src/controllers/items/getItems.ts index 193ed8da..2d2c76a0 100644 --- a/src/controllers/items/getItems.ts +++ b/src/controllers/items/getItems.ts @@ -1,13 +1,13 @@ import { NextFunction, Request, Response } from 'express'; -import { isShopAllowed } from '../../middlewares/settings'; +// import { isShopAllowed } from '../../middlewares/settings'; import { fetchUserItems } from '../../operations/item'; import { filterItem } from '../../utils/filters'; import { success } from '../../utils/responses'; import { getRequestInfo } from '../../utils/users'; export default [ - // Middlewares - isShopAllowed, + // Middlewares (commented out to allow users to access the list of their purchases) + // isShopAllowed, // Controller async (request: Request, response: Response, next: NextFunction) => { diff --git a/src/operations/carts.ts b/src/operations/carts.ts index de6515cb..23dc7542 100644 --- a/src/operations/carts.ts +++ b/src/operations/carts.ts @@ -125,9 +125,8 @@ export const forcePay = (user: Pick) => { case UserType.spectator: itemId = `ticket-${user.type}`; break; - default: { - throw new Error(`Can't pay for ${user.type}`); - } + default: + itemId = `ticket-${UserType.spectator}`; } return database.cart.create({