Last active
April 18, 2022 20:37
-
-
Save justinbmeyer/46ed3ba43437ff825131c23997340a70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async $beforeInsert (queryContext) { | |
await super.$beforeInsert(queryContext) | |
validateStartDate(this) | |
const trx = await Person.startTransaction(); | |
await this.validateAssignmentOverlap(this, trx) | |
queryContext.resolveTransaction = trx; | |
} | |
async $afterInsert (queryContext) { | |
await super.$afterInsert(queryContext) | |
queryContext.resolveTransaction.commit(); | |
} | |
// MAKE SURE TO HANDLE ROLLBACK!~! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment