Skip to content

Commit

Permalink
Fixed: fix documentation for createAndVerify #164
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed Jun 21, 2024
1 parent 1596737 commit ffbfa4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ving/docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ outline: deep
* NOTE: All your UI stuff will need to be updated to work with Tailwind and PrimeVue 4.
* Added DarkModeSelector component.
* Added ving-theme.
* Fixed: fix documentation for createAndVerify #164

### 2024-06-06
* Fixed documentation for ving/utils/fs readJSON and writeJSON
Expand Down
5 changes: 4 additions & 1 deletion ving/record/VingRecord.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,14 @@ export class VingKind {
*
* @param {Object} props A list of props
* @param {Object} currentUser A `User` or `Session`
* @throws 441 if no currentUser is passed
* @returns {VingRecord} A newly minted record or throws an error if validation fails
* @example
* const record = await Users.createAndVerify({username: 'andy'})
* const record = await Users.createAndVerify({username: 'andy'}, currentUser)
*/
async createAndVerify(props, currentUser) {
if (isUndefined(currentUser))
throw ving.ouch(441, `createAndVerify requires a user or session to test privileges against`);
const obj = this.mint({});
obj.testCreationProps(props);
await obj.setPostedProps(props, currentUser);
Expand Down

0 comments on commit ffbfa4e

Please sign in to comment.