refs #6085 findOne
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-12-11 12:45:55 +01:00
parent 53ff8784ff
commit 2beb1f65f0
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ module.exports = Self => {
where: {principalId: userId}
});
const availableMailAlias = await models.MailAliasAcl.find({
const availableMailAlias = await models.MailAliasAcl.findOne({
fields: ['mailAliasFk'],
include: {relation: 'mailAlias'},
where: {
@ -40,6 +40,6 @@ module.exports = Self => {
}
});
if (!availableMailAlias.length) throw new UserError('The alias cant be modified');
if (!availableMailAlias) throw new UserError('The alias cant be modified');
}
};