Fix mistaken usage of getOrFail with await
This commit is contained in:
parent
56cc192a9f
commit
67b2890c3f
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue