hiteshchoudhary / chai-backend

A video series on chai aur code youtube channel
5.06k stars 760 forks source link

files are not unlinking if a registered user again registers with avatar and coverImage #17

Open Harsh-J opened 10 months ago

Harsh-J commented 10 months ago

Hi, so if a registered user calls the "register" api again with avatar and coverImage field in body then multer uploads the files in public/temp and there is no unlinking happening there and can be fixed with the check in "if" block of "existedUser" we can unlink there

aamir-067 commented 10 months ago

i have the same issue but when i console.log() the file i sent to multer. middlware then it was path so i removed the .path andthe problem is solved