nghiavt2906 / Web-Scraping-BE

0 stars 0 forks source link

[Feature] Implement validation logic to process less than 100 keywords #9

Open olivierobert opened 1 year ago

olivierobert commented 1 year ago

Issue

The current implementation does not prevent the processing of more than 100 keywords:

https://github.com/nghiavt2906/Web-Scraping-BE/blob/57c918214c75686543944fa0368f7b94fed78368/src/services/report.js#L10-L16

Note This is a requirement for the code challenge: Screenshot 2566-03-09 at 13 53 27

Expected

To improve the UX, the content of the CSV should be processed and validated before starting any scraping. If a user uploads more than 100 keywords, an error must be displayed on the UI.

nghiavt2906 commented 1 year ago

Done adding validation of file size. Please have a look: https://github.com/nghiavt2906/Web-Scraping-BE/blob/38d42ee07342f6b357714a526ca973559fe86a8c/src/services/report.js#L9-L15 https://github.com/nghiavt2906/Web-Scraping-BE/blob/38d42ee07342f6b357714a526ca973559fe86a8c/src/controllers/report.controller.js#L6-L32