ikismail/Angular-ShoppingCart

Not Able To Add Products

JhansiMNS opened this issue · 3 comments

How Do I Switch To The Admin Mode? Where Do I Do These Changes "isAdmin==true"?

Haha, currently in the same place. It was all going so well. :D

I got it. If you search the entire project for admin (CTRL+SHIFT+F in Visual Studio Code) you can see on line 55 of auth.service.ts:

loggedUser.isAdmin = user.email === "admin@gmail.com" ? true : false;

So if the current user is admin@gmail.com it will be the admin user and you can add products.

If you just register a new user with admin@gmail.com it'll work as the admin user, or update that line to your own user.

Its a temporary one, I will update the logic soon 🔥. sorry for the inconvenience, 🙏