You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to generate random numbers, hashes etc, as well as allow values to be derived from another value allow the defaultValue property to be a handler function which takes the current operation and assigns a value to it.
i.e...
// Memberconstmember={schema: {name: {[method]: {// i.e. 'post'defaultValue(item){return`${item.firstName}${item.lastName}`;}}}}};constdare=newDare({models: {member}});// Postawaitdare.post('member',{firstName: 'Andrew',lastName: 'Dodson',});// # Generates the query...// INSERT INTO member (firstName, lastName, name)// VALUES ('Andrew', 'Dodson', 'Andrew Dodson');
The text was updated successfully, but these errors were encountered:
In order to generate random numbers, hashes etc, as well as allow values to be derived from another value allow the
defaultValue
property to be a handler function which takes the current operation and assigns a value to it.i.e...
The text was updated successfully, but these errors were encountered: