bradtraversy / proshop_mern

Shopping cart built with MERN & Redux
1.99k stars 1.18k forks source link

Quick Error W/ Postman. #39

Closed talmax1124 closed 3 years ago

talmax1124 commented 3 years ago

Lecture 56 Hi, I am having this error. Have two different errors one in safari and the other in chrome. How do i fix this error?

Safari: Screen Shot 2020-10-21 at 3 37 51 PM

Chrome: Screen Shot 2020-10-21 at 3 38 13 PM

Repository: https://github.com/talmax1124/cduoshop

you can also contact me through email: carlitosdiazplaza@gmail.com

bradtraversy commented 3 years ago

Please post in udemy q/a. This is a student issue. That is not what this github repo is for

On Wed, Oct 21, 2020 at 3:49 PM Carlos notifications@github.com wrote:

Lecture 56 Hi, I am having this error. Have two different errors one in safari and the other in chrome. How do i fix this error?

Safari: [image: Screen Shot 2020-10-21 at 3 37 51 PM] https://user-images.githubusercontent.com/61528430/96774787-8d43bd80-13b4-11eb-8093-16f50e6f6753.png

Chrome: [image: Screen Shot 2020-10-21 at 3 38 13 PM] https://user-images.githubusercontent.com/61528430/96774812-946acb80-13b4-11eb-8e4d-c8be7d531a3c.png

Repository: https://github.com/talmax1124/cduoshop

you can also contact me through email: carlitosdiazplaza@gmail.com

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAUNHOKZBPTZ5WL4X4DSL43LRANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

talmax1124 commented 3 years ago

@bradtraversy, it takes too long for students to respond

On Wed, Oct 21, 2020 at 3:49 PM Carlos notifications@github.com wrote:

Lecture 56 Hi, I am having this error. Have two different errors one in safari and the other in chrome. How do i fix this error?

Safari: [image: Screen Shot 2020-10-21 at 3 37 51 PM] https://user-images.githubusercontent.com/61528430/96774787-8d43bd80-13b4-11eb-8093-16f50e6f6753.png

Chrome: [image: Screen Shot 2020-10-21 at 3 38 13 PM] https://user-images.githubusercontent.com/61528430/96774812-946acb80-13b4-11eb-8e4d-c8be7d531a3c.png

Repository: https://github.com/talmax1124/cduoshop

you can also contact me through email: carlitosdiazplaza@gmail.com

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3X7FNWNNZPE7HZSVZLSL43LRANCNFSM4S2HKZYQ .

talmax1124 commented 3 years ago

Error In NavBar and admin and name disappears once i reload Hello, I am in video 69 and I am trying to fix the nav but it keeps giving me the same error. Also the name disappears like if the token is not there anymore. Please Help Me. Below is a video of the error.

Video of the error: Youtube Video Screen Recording Of What it is doing

Photos of what it says in console.

image image

I did check the authmiddleware and I copied and pasted from the repo to see if i had misspelled something but still gives me the same error.

Here is my repository: github.com/talmax1124/cduoshop

@bradtraversy @basir

bradtraversy commented 3 years ago

Ill check it out on Monday. Let me know if you find the solution by then

On Fri, Oct 23, 2020 at 12:37 PM Carlos notifications@github.com wrote:

Error In NavBar and admin and name disappears once i reload Hello, I am in video 69 and I am trying to fix the nav but it keeps giving me the same error. Also the name disappears like if the token is not there anymore. Please Help Me. Below is a video of the error.

Video of the error: Youtube Video Screen Recording Of What it is doing https://youtu.be/whpGOiWSteE

Photos of what it says in console.

[image: image] https://user-images.githubusercontent.com/61528430/97030081-4973c400-152c-11eb-8de3-1da8d1b5b17a.png [image: image] https://user-images.githubusercontent.com/61528430/97030091-4e387800-152c-11eb-9d71-233074828fca.png

I did check the authmiddleware and I copied and pasted from the repo to see if i had misspelled something but still gives me the same error.

Here is my repository: github.com/talmax1124/cduoshop

@bradtraversy https://github.com/bradtraversy @basir https://github.com/basir

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-715449686, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAS3DZMGTYQXXLYPM5TSMGWLFANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

bradtraversy commented 3 years ago

In your userActions.js on line 209 you are setting the users you fetch from the backend to your localStorage userInfo. This is going to mess up a whole bunch of stuff. Remove that line

On Fri, Oct 23, 2020 at 3:07 PM Brad Traversy traversymedia@gmail.com wrote:

Ill check it out on Monday. Let me know if you find the solution by then

On Fri, Oct 23, 2020 at 12:37 PM Carlos notifications@github.com wrote:

Error In NavBar and admin and name disappears once i reload Hello, I am in video 69 and I am trying to fix the nav but it keeps giving me the same error. Also the name disappears like if the token is not there anymore. Please Help Me. Below is a video of the error.

Video of the error: Youtube Video Screen Recording Of What it is doing https://youtu.be/whpGOiWSteE

Photos of what it says in console.

[image: image] https://user-images.githubusercontent.com/61528430/97030081-4973c400-152c-11eb-8de3-1da8d1b5b17a.png [image: image] https://user-images.githubusercontent.com/61528430/97030091-4e387800-152c-11eb-9d71-233074828fca.png

I did check the authmiddleware and I copied and pasted from the repo to see if i had misspelled something but still gives me the same error.

Here is my repository: github.com/talmax1124/cduoshop

@bradtraversy https://github.com/bradtraversy @basir https://github.com/basir

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-715449686, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAS3DZMGTYQXXLYPM5TSMGWLFANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

-- Brad Traversy Traversy Media

bradtraversy commented 3 years ago

Try to trace the entire process when you run into an issue. Check the action, what is sent to the reducer, how it is brought into the component, etc. This will help you pinpoint the problem

On Fri, Oct 23, 2020 at 3:16 PM Brad Traversy traversymedia@gmail.com wrote:

In your userActions.js on line 209 you are setting the users you fetch from the backend to your localStorage userInfo. This is going to mess up a whole bunch of stuff. Remove that line

On Fri, Oct 23, 2020 at 3:07 PM Brad Traversy traversymedia@gmail.com wrote:

Ill check it out on Monday. Let me know if you find the solution by then

On Fri, Oct 23, 2020 at 12:37 PM Carlos notifications@github.com wrote:

Error In NavBar and admin and name disappears once i reload Hello, I am in video 69 and I am trying to fix the nav but it keeps giving me the same error. Also the name disappears like if the token is not there anymore. Please Help Me. Below is a video of the error.

Video of the error: Youtube Video Screen Recording Of What it is doing https://youtu.be/whpGOiWSteE

Photos of what it says in console.

[image: image] https://user-images.githubusercontent.com/61528430/97030081-4973c400-152c-11eb-8de3-1da8d1b5b17a.png [image: image] https://user-images.githubusercontent.com/61528430/97030091-4e387800-152c-11eb-9d71-233074828fca.png

I did check the authmiddleware and I copied and pasted from the repo to see if i had misspelled something but still gives me the same error.

Here is my repository: github.com/talmax1124/cduoshop

@bradtraversy https://github.com/bradtraversy @basir https://github.com/basir

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-715449686, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAS3DZMGTYQXXLYPM5TSMGWLFANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

-- Brad Traversy Traversy Media

-- Brad Traversy Traversy Media

talmax1124 commented 3 years ago

Thank you so much. I will definitely use that advice.

On Fri, Oct 23, 2020 at 3:18 PM Brad Traversy notifications@github.com wrote:

Try to trace the entire process when you run into an issue. Check the action, what is sent to the reducer, how it is brought into the component, etc. This will help you pinpoint the problem

On Fri, Oct 23, 2020 at 3:16 PM Brad Traversy traversymedia@gmail.com wrote:

In your userActions.js on line 209 you are setting the users you fetch from the backend to your localStorage userInfo. This is going to mess up a whole bunch of stuff. Remove that line

On Fri, Oct 23, 2020 at 3:07 PM Brad Traversy traversymedia@gmail.com wrote:

Ill check it out on Monday. Let me know if you find the solution by then

On Fri, Oct 23, 2020 at 12:37 PM Carlos notifications@github.com wrote:

Error In NavBar and admin and name disappears once i reload Hello, I am in video 69 and I am trying to fix the nav but it keeps giving me the same error. Also the name disappears like if the token is not there anymore. Please Help Me. Below is a video of the error.

Video of the error: Youtube Video Screen Recording Of What it is doing https://youtu.be/whpGOiWSteE

Photos of what it says in console.

[image: image] < https://user-images.githubusercontent.com/61528430/97030081-4973c400-152c-11eb-8de3-1da8d1b5b17a.png

[image: image] < https://user-images.githubusercontent.com/61528430/97030091-4e387800-152c-11eb-9d71-233074828fca.png

I did check the authmiddleware and I copied and pasted from the repo to see if i had misspelled something but still gives me the same error.

Here is my repository: github.com/talmax1124/cduoshop

@bradtraversy https://github.com/bradtraversy @basir https://github.com/basir

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-715449686 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABKLGAS3DZMGTYQXXLYPM5TSMGWLFANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

-- Brad Traversy Traversy Media

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-715533959, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3WPZXOECSXNERXM4Z3SMHJIJANCNFSM4S2HKZYQ .

talmax1124 commented 3 years ago

Hi, I just need some quick help with the postman. I know it is dumb and this is going to take like 1 minute for you guys to figure out but i am logged in as admin in the postman but it says isAdmin is required. But i am a admin. Please look at the images below for a more in details. And i checked the controller as well

image

Me logged in:

image

my repository:github.com/talmax1124/cduoshop @basir @bradtraversy

talmax1124 commented 3 years ago

@basir @bradtraversy I even copied the code from github and that did not work.

bradtraversy commented 3 years ago

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos notifications@github.com wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

talmax1124 commented 3 years ago

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy notifications@github.com wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos notifications@github.com wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ .

bradtraversy commented 3 years ago

I'm really not sure

On Mon, Oct 26, 2020 at 9:11 AM Carlos notifications@github.com wrote:

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy notifications@github.com wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos notifications@github.com wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535907, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAUDWSG47ML5PDXVKALSMVYPZANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

talmax1124 commented 3 years ago

@bradtraversy For me in postman right now it says User validation failed: isAdmin: Path isAdmin is required Should I just continue on?

talmax1124 commented 3 years ago

@bradtraversy Should i just continue on without postman? It still says "message": "User validation failed: isAdmin: Path isAdmim is required. I know for sure I am logged in as a admin in postman.

On Mon, Oct 26, 2020 at 9:14 AM Brad Traversy notifications@github.com wrote:

I'm really not sure

On Mon, Oct 26, 2020 at 9:11 AM Carlos notifications@github.com wrote:

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy notifications@github.com wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos notifications@github.com wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535907 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABKLGAUDWSG47ML5PDXVKALSMVYPZANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716537815, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3R3ML3A2DEZV6OO6NDSMVY5FANCNFSM4S2HKZYQ .

bradtraversy commented 3 years ago

For some reason isAdmin is not being filled. It has a default value in the model so I don't know why it is undefined. MAke sure the user that you get in the update controller function is actually being pulled in const user = await User.findById(req.user._id)

On Mon, Oct 26, 2020 at 9:50 AM Carlos notifications@github.com wrote:

@bradtraversy Should i just continue on without postman? It still says "message": "User validation failed: isAdmin: Path isAdmim is required. I know for sure I am logged in as a admin in postman.

On Mon, Oct 26, 2020 at 9:14 AM Brad Traversy notifications@github.com wrote:

I'm really not sure

On Mon, Oct 26, 2020 at 9:11 AM Carlos notifications@github.com wrote:

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy < notifications@github.com> wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos notifications@github.com wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535907

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUDWSG47ML5PDXVKALSMVYPZANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716537815 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOVNS3R3ML3A2DEZV6OO6NDSMVY5FANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716558984, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAUX5HL6KEP3ROCWBCTSMV5DVANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

talmax1124 commented 3 years ago

What file is that in? Also I just continued on to the next video the Updating user video and I updated the user in the website itself and it works. But I don't know why postman doesnt want to do it.

On Mon, Oct 26, 2020 at 11:42 AM Brad Traversy notifications@github.com wrote:

For some reason isAdmin is not being filled. It has a default value in the model so I don't know why it is undefined. MAke sure the user that you get in the update controller function is actually being pulled in const user = await User.findById(req.user._id)

On Mon, Oct 26, 2020 at 9:50 AM Carlos notifications@github.com wrote:

@bradtraversy Should i just continue on without postman? It still says "message": "User validation failed: isAdmin: Path isAdmim is required. I know for sure I am logged in as a admin in postman.

On Mon, Oct 26, 2020 at 9:14 AM Brad Traversy notifications@github.com wrote:

I'm really not sure

On Mon, Oct 26, 2020 at 9:11 AM Carlos notifications@github.com wrote:

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy < notifications@github.com> wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos notifications@github.com wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535907

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUDWSG47ML5PDXVKALSMVYPZANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716537815

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3R3ML3A2DEZV6OO6NDSMVY5FANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716558984 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABKLGAUX5HL6KEP3ROCWBCTSMV5DVANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716633596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3QGOOTMPIIHH2K5QATSMWKHPANCNFSM4S2HKZYQ .

bradtraversy commented 3 years ago

The controller function to update a user (updateUserProfile) in userController.js

log the user from the findById. Does it look right?

On Mon, Oct 26, 2020 at 11:45 AM Carlos notifications@github.com wrote:

What file is that in? Also I just continued on to the next video the Updating user video and I updated the user in the website itself and it works. But I don't know why postman doesnt want to do it.

On Mon, Oct 26, 2020 at 11:42 AM Brad Traversy notifications@github.com wrote:

For some reason isAdmin is not being filled. It has a default value in the model so I don't know why it is undefined. MAke sure the user that you get in the update controller function is actually being pulled in const user = await User.findById(req.user._id)

On Mon, Oct 26, 2020 at 9:50 AM Carlos notifications@github.com wrote:

@bradtraversy Should i just continue on without postman? It still says "message": "User validation failed: isAdmin: Path isAdmim is required. I know for sure I am logged in as a admin in postman.

On Mon, Oct 26, 2020 at 9:14 AM Brad Traversy < notifications@github.com> wrote:

I'm really not sure

On Mon, Oct 26, 2020 at 9:11 AM Carlos notifications@github.com wrote:

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy < notifications@github.com> wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos < notifications@github.com> wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535907

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUDWSG47ML5PDXVKALSMVYPZANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716537815

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3R3ML3A2DEZV6OO6NDSMVY5FANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716558984

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUX5HL6KEP3ROCWBCTSMV5DVANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716633596 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOVNS3QGOOTMPIIHH2K5QATSMWKHPANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716635352, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLGAUBSKFEXVEHMZ572H3SMWKRDANCNFSM4S2HKZYQ .

-- Brad Traversy Traversy Media

talmax1124 commented 3 years ago

I checked that file you stated and it had the same thing you told me to check. I think it might be a problem with Postman. It is not updating in postman but at least the website is doing it correctly.

On Mon, Oct 26, 2020 at 11:54 AM Brad Traversy notifications@github.com wrote:

The controller function to update a user (updateUserProfile) in userController.js

log the user from the findById. Does it look right?

On Mon, Oct 26, 2020 at 11:45 AM Carlos notifications@github.com wrote:

What file is that in? Also I just continued on to the next video the Updating user video and I updated the user in the website itself and it works. But I don't know why postman doesnt want to do it.

On Mon, Oct 26, 2020 at 11:42 AM Brad Traversy <notifications@github.com

wrote:

For some reason isAdmin is not being filled. It has a default value in the model so I don't know why it is undefined. MAke sure the user that you get in the update controller function is actually being pulled in const user = await User.findById(req.user._id)

On Mon, Oct 26, 2020 at 9:50 AM Carlos notifications@github.com wrote:

@bradtraversy Should i just continue on without postman? It still says "message": "User validation failed: isAdmin: Path isAdmim is required. I know for sure I am logged in as a admin in postman.

On Mon, Oct 26, 2020 at 9:14 AM Brad Traversy < notifications@github.com> wrote:

I'm really not sure

On Mon, Oct 26, 2020 at 9:11 AM Carlos notifications@github.com wrote:

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy < notifications@github.com> wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos < notifications@github.com> wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535907

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUDWSG47ML5PDXVKALSMVYPZANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716537815

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3R3ML3A2DEZV6OO6NDSMVY5FANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716558984

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUX5HL6KEP3ROCWBCTSMV5DVANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716633596

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QGOOTMPIIHH2K5QATSMWKHPANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716635352 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABKLGAUBSKFEXVEHMZ572H3SMWKRDANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716641822, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVNS3VNKAMYPWP72KJ3A2LSMWLUXANCNFSM4S2HKZYQ .

talmax1124 commented 3 years ago

@basir @bradtraversy How would I do something like selecting a variation of products? Like a dropdown to select the product variation and would I need to pass it somewhere else?

basir commented 3 years ago

Images input box has value but you get required error on backend. It means you did not send the image to backend or you do receive and set it to image field on backend. Check these two possibilities and let me know.

On Tue, Oct 27, 2020 at 2:22 AM Carlos notifications@github.com wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy Is there a way to fix this : Product validation failed: image: Path image is required. without going to product model and taking required off? [image: Screen Shot 2020-10-26 at 6 51 49 PM] https://user-images.githubusercontent.com/61528430/97236817-50b10100-17bc-11eb-9f63-271e4da9e9b7.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716866925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ44CHOXHQSSEPIDUBTSMX4SBANCNFSM4S2HKZYQ .

basir commented 3 years ago

It happens when you set null for input boxes. Find the and replace them with empty string

On Tue, Oct 27, 2020 at 2:47 AM Carlos notifications@github.com wrote:

Is there a way to fix this message:

Warning: A component is changing a controlled input of type text to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components in input (created by FormControl) in FormControl (at ProductEditScreen.js:96) in div (created by FormGroup) in FormGroup (at ProductEditScreen.js:94) in form (created by Form) in Form (at ProductEditScreen.js:73) in div (created by Col) in Col (at FormContainer.js:8) in div (created by Row) in Row (at FormContainer.js:7) in div (created by Container) in Container (at FormContainer.js:6) in FormContainer (at ProductEditScreen.js:64) in ProductEditScreen (created by Context.Consumer) in Route (at App.js:39) in div (created by Container) in Container (at App.js:26) in main (at App.js:25) in Router (created by BrowserRouter) in BrowserRouter (at App.js:23) in App (at src/index.js:12) in Provider (at src/index.js:11)

and fix this: Product validation failed: image: Path image is required. ?

I checked product model in backend and removed required but when i go back and edit it back it does not update that image.

github.com/talmax1124/cduoshop

On Mon, Oct 26, 2020 at 11:54 AM Brad Traversy notifications@github.com wrote:

The controller function to update a user (updateUserProfile) in userController.js

log the user from the findById. Does it look right?

On Mon, Oct 26, 2020 at 11:45 AM Carlos notifications@github.com wrote:

What file is that in? Also I just continued on to the next video the Updating user video and I updated the user in the website itself and it works. But I don't know why postman doesnt want to do it.

On Mon, Oct 26, 2020 at 11:42 AM Brad Traversy < notifications@github.com

wrote:

For some reason isAdmin is not being filled. It has a default value in the model so I don't know why it is undefined. MAke sure the user that you get in the update controller function is actually being pulled in const user = await User.findById(req.user._id)

On Mon, Oct 26, 2020 at 9:50 AM Carlos notifications@github.com wrote:

@bradtraversy Should i just continue on without postman? It still says "message": "User validation failed: isAdmin: Path isAdmim is required. I know for sure I am logged in as a admin in postman.

On Mon, Oct 26, 2020 at 9:14 AM Brad Traversy < notifications@github.com> wrote:

I'm really not sure

On Mon, Oct 26, 2020 at 9:11 AM Carlos <notifications@github.com

wrote:

So you think it might be postman itself.

On Mon, Oct 26, 2020 at 9:10 AM Brad Traversy < notifications@github.com> wrote:

I just tried updating a user with your version of the app and it worked fine

On Sun, Oct 25, 2020 at 10:37 PM Carlos < notifications@github.com> wrote:

@basir https://github.com/basir @bradtraversy https://github.com/bradtraversy I even copied the code from github and that did not work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716270118

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAQHLSK7C2BCYXZXKALSMTOHTANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535249

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QWZITMIFRBLJRG2ILSMVYLHANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716535907

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUDWSG47ML5PDXVKALSMVYPZANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716537815

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3R3ML3A2DEZV6OO6NDSMVY5FANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716558984

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUX5HL6KEP3ROCWBCTSMV5DVANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716633596

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AOVNS3QGOOTMPIIHH2K5QATSMWKHPANCNFSM4S2HKZYQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <

https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716635352

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABKLGAUBSKFEXVEHMZ572H3SMWKRDANCNFSM4S2HKZYQ

.

-- Brad Traversy Traversy Media

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716641822 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOVNS3VNKAMYPWP72KJ3A2LSMWLUXANCNFSM4S2HKZYQ

.

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradtraversy/proshop_mern/issues/39#issuecomment-716876119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ6WVTLTGBFD5LPGC33SMX7RTANCNFSM4S2HKZYQ .

talmax1124 commented 3 years ago

It happens when you set null for input boxes. Find the and replace them with empty string

I fixed it. It was a typo. @basir

chenjuexu commented 2 years ago

Thanks your posting on this question@talmax1124