@@ -20,16 +20,16 @@ export abstract class CreateRunnerGroup {
|
||||
contact?: number;
|
||||
|
||||
/**
|
||||
* Deals with the contact for groups this.
|
||||
* Get's this group's contact from this.address.
|
||||
*/
|
||||
public async getContact(): Promise<GroupContact> {
|
||||
if (this.contact === undefined) {
|
||||
return null;
|
||||
}
|
||||
if (!isNaN(this.contact)) {
|
||||
let address = await getConnectionManager().get().getRepository(GroupContact).findOne({ id: this.contact });
|
||||
if (!address) { throw new GroupContactNotFoundError; }
|
||||
return address;
|
||||
let contact = await getConnectionManager().get().getRepository(GroupContact).findOne({ id: this.contact });
|
||||
if (!contact) { throw new GroupContactNotFoundError; }
|
||||
return contact;
|
||||
}
|
||||
|
||||
throw new GroupContactWrongTypeError;
|
||||
|
||||
Reference in New Issue
Block a user