|
|
@@ -1,7 +1,5 @@ |
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
import { DateInputProperties } from 'src/app/widgets/form/date-input/date-input.component'; |
|
|
|
import { GenericInputProperties } from 'src/app/widgets/form/generic-input/generic-input.component'; |
|
|
|
import { SelectInputProperties } from 'src/app/widgets/form/select-input/select-input.component'; |
|
|
|
import { RegisterBusinessNameService } from 'src/app/services/register-business-name.service'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-register-business', |
|
|
@@ -107,7 +105,7 @@ export class RegisterBusinessComponent implements OnInit { |
|
|
|
value: 'Net Banking', |
|
|
|
}]; |
|
|
|
|
|
|
|
constructor() { } |
|
|
|
constructor(private registerBusinessNameService: RegisterBusinessNameService) { } |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
} |
|
|
@@ -160,21 +158,23 @@ export class RegisterBusinessComponent implements OnInit { |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
|
|
|
|
checkName() { |
|
|
|
async checkName() { |
|
|
|
this.formState = 'INIT_REGISTER'; |
|
|
|
|
|
|
|
if (this.nameToCheck === `A'DROIT MANAGEMENT SERVICES`) { |
|
|
|
this.error = { |
|
|
|
message: this.nameToCheck + ' is unavailable. Entity with identical name exists', |
|
|
|
isUnique: false, |
|
|
|
isInvalid: false, |
|
|
|
}; |
|
|
|
} else { |
|
|
|
const nameCheckResponse = await this.registerBusinessNameService.checkName(this.nameToCheck); |
|
|
|
|
|
|
|
if (nameCheckResponse.status === `success`) { |
|
|
|
this.error = { |
|
|
|
message: this.nameToCheck + ' is available', |
|
|
|
isUnique: true, |
|
|
|
isInvalid: false |
|
|
|
}; |
|
|
|
} else { |
|
|
|
this.error = { |
|
|
|
message: this.nameToCheck + ' is unavailable. ' + nameCheckResponse.status, |
|
|
|
isUnique: false, |
|
|
|
isInvalid: false, |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|