Docker compose con variabili d'ambiente
This commit is contained in:
@@ -32,6 +32,27 @@ class UsersRepository {
|
||||
}
|
||||
}
|
||||
|
||||
async count() {
|
||||
try {
|
||||
return await this.User.count();
|
||||
} catch (error) {
|
||||
throw new DatabaseError('Failed to count users', error);
|
||||
}
|
||||
}
|
||||
|
||||
async countWithScoreAbove(score, excludeId) {
|
||||
try {
|
||||
return await this.User.count({
|
||||
where: {
|
||||
score: { [Op.gt]: score },
|
||||
id: { [Op.ne]: excludeId },
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
throw new DatabaseError('Failed to count users above score', error);
|
||||
}
|
||||
}
|
||||
|
||||
async findById(id, options = {}) {
|
||||
try {
|
||||
const user = await this.User.findByPk(id, options);
|
||||
|
||||
Reference in New Issue
Block a user