( req: MarkRequired<Partial<PayloadRequest>, 'payload'>, )
| 6 | * Rollback the transaction from the req using the db adapter and removes it from the req |
| 7 | */ |
| 8 | export async function killTransaction( |
| 9 | req: MarkRequired<Partial<PayloadRequest>, 'payload'>, |
| 10 | ): Promise<void> { |
| 11 | const { payload, transactionID } = req |
| 12 | if (transactionID && !(transactionID instanceof Promise)) { |
| 13 | try { |
| 14 | await payload.db.rollbackTransaction(req.transactionID!) |
| 15 | } catch (ignore) { |
| 16 | // swallow any errors while attempting to rollback |
| 17 | } |
| 18 | delete req.transactionID |
| 19 | } |
| 20 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…