Fix multiple bugs

This commit is contained in:
Tiberiu Ichim 2026-02-06 22:35:03 +02:00
parent ef3f39191d
commit f511e0046d
5 changed files with 198 additions and 188 deletions

View file

@ -27,13 +27,15 @@ class BookAuthor extends Model {
* Get number of books for author
*
* @param {string} authorId
* @param {import('sequelize').Transaction} [transaction]
* @returns {Promise<number>}
*/
static getCountForAuthor(authorId) {
static getCountForAuthor(authorId, transaction = null) {
return this.count({
where: {
authorId
}
},
transaction
})
}