Switched to accepting ids (numbers/number arrays) feature/90-accept_objects #101

Merged
niggl merged 26 commits from feature/90-accept_objects into dev 2021-01-15 17:57:47 +00:00
2 changed files with 2 additions and 0 deletions
Showing only changes of commit ba218c85e0 - Show all commits

View File

@ -56,6 +56,7 @@ export class CreateGroupContact {
* Gets the new contact's address by it's id. * Gets the new contact's address by it's id.
*/ */
public async getAddress(): Promise<Address> { public async getAddress(): Promise<Address> {
if (!this.address) { return null; }
let address = await getConnectionManager().get().getRepository(Address).findOne({ id: this.address }); let address = await getConnectionManager().get().getRepository(Address).findOne({ id: this.address });
if (!address) { throw new AddressNotFoundError; } if (!address) { throw new AddressNotFoundError; }
return address; return address;

View File

@ -57,6 +57,7 @@ export abstract class CreateParticipant {
* Gets the new participant's address by it's id. * Gets the new participant's address by it's id.
*/ */
public async getAddress(): Promise<Address> { public async getAddress(): Promise<Address> {
if (!this.address) { return null; }
let address = await getConnectionManager().get().getRepository(Address).findOne({ id: this.address }); let address = await getConnectionManager().get().getRepository(Address).findOne({ id: this.address });
if (!address) { throw new AddressNotFoundError; } if (!address) { throw new AddressNotFoundError; }
return address; return address;