bfforsythe / NotFlix

3 stars 0 forks source link

Repetitive code in app.js #21

Closed nidamon closed 1 year ago

nidamon commented 1 year ago

app.js lines 185-187 these lines could be simplified into "Action: myFunction("Action"), where myFunction(myGenre) contains {urlData.filter(movie => movie.genre === myGenre).map(movie => movie.url) } especially in the case of adding more genres

app.js line 204 addUser and line 219 addMovie have very similar code (collection name and inserted object are the only differences) app.js line 303 getMovie could just call findMovie(url)._id

bfforsythe commented 1 year ago

implemented new function, modularized 😎 (for MovieGenres), disregarding other edits as fundemental restructuring of code would be necessary.

nidamon commented 1 year ago

Ok, I see it.

nidamon commented 1 year ago

First part is done but second is not.

bfforsythe commented 1 year ago

issues sorted, code has been modularized