ojasaklechayt / Oju-s-Blogs

A full MERN Stack Blogging website to write out yourself
https://oju-blogs.vercel.app
10 stars 14 forks source link

[Add Blog feature] Adding Validation to Image field while posting a blog #17

Closed MukulVashishth closed 10 months ago

MukulVashishth commented 10 months ago

Observed an issue while creating a new blog that we can populate any invalid data in the image field.

As a result the image is not rendered.

image

image

I can work on this. @ojasaklechayt Can you please assign this issue to me under hacktoberfest .

ojasaklechayt commented 10 months ago

How do you plan to fix it ?

MukulVashishth commented 10 months ago

We have 2 options for this :

i) We can make the user to upload an image by providing that option instead of pasting the link.

ii) If we need to keep the 'ImageURL' field then we need to keep a regex validation for URL validation.

ojasaklechayt commented 10 months ago

We have 2 options for this :

i) We can make the user to upload an image by providing that option instead of pasting the link.

ii) If we need to keep the 'ImageURL' field then we need to keep a regex validation for URL validation.

I would recommend to go for user to upload the photo instead of pasting the link

ojasaklechayt commented 10 months ago

@MukulVashishth I feel we need to update backend also for this. Please do have look if soo.

aasimtaif commented 10 months ago

@MukulVashishth I feel we need to update backend also for this. Please do have look if soo.

you do not need to update the backend for this you just have to convert image to base64 and pass it as a string to backend