foyzulkarim / mern-video-streaming

MERN Video Streaming is a cutting-edge, open-source platform for video streaming, offering a comprehensive, full-stack solution utilizing the latest MERN stack technologies.
MIT License
182 stars 63 forks source link

video edit page #82

Closed aninda052 closed 1 year ago

aninda052 commented 1 year ago

This will close #55

foyzulkarim commented 1 year ago

Hi @aninda052 thanks for the awesome work. Let's not over-use our upload page and keep it as it is. Can you create a new VideoEditPage to edit the text values (NOT the uploaded video itself) please?

Also, take the latest code from main branch. Update the List page and add a Edit button in the actions (keep the Delete action but remove the other actions).

Otherwise all code seems good.

aninda052 commented 1 year ago

Can you create a new VideoEditPage to edit the text values (NOT the uploaded video itself) please?

@foyzulkarim vai, the reason behind the re-use of upload page is to not use duplicate codes. Codes for upload and edit page will be almost same. Also if we use separate file, in future if we have to add a new field in 'upload' page, we also have to do the same things for edit page. Is it possible to tell me in details why we want to keep separate files ?

foyzulkarim commented 1 year ago

Good point. I like your argument. But it is most likely we will not be showing all fields in the upload page. And we will not edit all fields as well. Also, if we create different logics while uploading and editing, then it will be too much complicated to manage in a single page. For now, it seems duplicate, but in the long run, it is not that much duplicate.

aninda052 commented 1 year ago

For now, it seems duplicate, but in the long run, it is not that much duplicate.

Now i understand. another question, what if we have exact number of fields in both upload and edit page then would you keep a single file or you will always prefer separate file ? which scenario would be a better option for keeping a single file ?

foyzulkarim commented 1 year ago

If the fields are same, then I would like to create a common Form for these two, but create two different page (wrapper type component) which will have their own separate logics. For example: if you don't want to give permission to everyone to edit, then the Edit page will be having that logic. This is a fine contradiction/balance between SRP and DYI principles. 🙂

aninda052 commented 1 year ago

If the fields are same, then I would like to create a common Form for these two, but create two different page (wrapper type component) which will have their own separate logics.

Thank you vai for this suggestion. i'll follow this in future <3

btw, i've pushed my updated code and update pull description.