hiteshchoudhary / chai-backend

A video series on chai aur code youtube channel
4.69k stars 697 forks source link

Update user.controller.js #142

Closed sahilshivekar closed 1 month ago

sahilshivekar commented 1 month ago

there was no need of using if condition with avatarLocalFile

made the logic easy for uploading coverImage

sahilshivekar commented 1 month ago

Does this not return the coverImage needed error?

we are not making coverImage mandatory for the user to upload only username, password, fullName, avatar is mandatory. So, no need to throw error if coverImage field is empty. if the coverImage is not there then we will not upload it.