Adding and Deleting items from Cart | NodeJS and Prisma ORM

Поділитися
Вставка
  • Опубліковано 13 січ 2025

КОМЕНТАРІ • 6

  • @OnlyJavascript
    @OnlyJavascript Рік тому

    can you please show us, how you would implement checking on updating his own cart and existence of same product in user's cart. it's difficult for newbies like me. thanks in advance.

    • @evoqys
      @evoqys  Рік тому

      Generally, if you are using any frameworks, you can use "object" permissions. But here you can write your custom logic to check the ocndition "cart.user.id==req.user.id" and throw the error accordingly.
      For same product, you can make another query before adding to check if the product already exist or not. Same thing we did in changeQuantity controller can be done in addCart as well if the product already exists. Hope this helps. Let me know if you have any other confusion regarding the same.

    • @OnlyJavascript
      @OnlyJavascript Рік тому

      @@evoqys thanks, I will give a try.

    • @saifalieee
      @saifalieee 6 місяців тому

      @@evoqys bro but for identifying the product presence we have to find that product in cartItem, but the issue is coming there is that product id is not unique, so how we could solve this issue

  • @OnlyJavascript
    @OnlyJavascript Рік тому

    please add forgot password and account activation functionality.