mai-soup / porch-reads-club

A MEVN stack application to help anyone manage their own little library online - manage inventory, members, loans.
https://porchreads.club/
MIT License
0 stars 0 forks source link

#CleanCode No inline js and use configuration variables #77

Closed Dr4gon closed 1 year ago

Dr4gon commented 1 year ago

@mai-soup The thing with inline js is - just don't do it. It has so many drawbacks:

LoansView.vue

// if the loan is due in 7 days or less, show a button to extend the loan
button(v-if="(new Date(loan.returnDate) - new Date()) < 1000 * 60 * 60 * 24 * 7" @click="doExtend(loan)") Extend

The idea here would be using a function call from JS and configure this value in your .env.

mai-soup commented 1 year ago

instead of environment variables, decided to assign the loan-related durations on a per-library basis (#113)