Fix mistaken usage of getOrFail with await

This commit is contained in:
Alice Gaudon 2020-11-03 09:46:25 +01:00
parent 56cc192a9f
commit 67b2890c3f
2 changed files with 2 additions and 2 deletions

View File

@ -33,6 +33,6 @@ export default class MailIdentity extends Model {
}
public async toEmail(): Promise<string> {
return this.name + '@' + (await this.domain.getOrFail())?.name;
return this.name + '@' + (await this.domain.get())?.name;
}
}

View File

@ -13,7 +13,7 @@ export default class UserMailIdentityComponent extends ModelComponent<User> {
foreignKey: 'user_id',
});
public readonly publicMailIdentities: ManyModelRelation<User, MailIdentity> = this.mailIdentities.clone()
.filter(async model => !!(await model.domain.getOrFail())?.isPublic());
.filter(async model => !!(await model.domain.get())?.isPublic());
public readonly mailDomains: ManyModelRelation<User, MailDomain> = new ManyModelRelation(this._model, MailDomain, {
localKey: 'id',