Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/bcgov/House-Policy-STRDSS in…
Browse files Browse the repository at this point in the history
…to dev
  • Loading branch information
ychung-mot committed Mar 15, 2024
2 parents 8fc3ec9 + e3bbf2b commit 5213deb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
5 changes: 1 addition & 4 deletions frontend/src/app/common/consts/validators.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ export function validateEmailListString(): ValidatorFn {
return (control: AbstractControl): ValidationErrors | null => {
let emailList;

if (control.value.constructor === Array) {
emailList = control.value;
}
else {
if (!!control.value) {
emailList = (control.value as string).split(',').filter(x => !!x).map(x => x.trim()) as Array<string>;
}

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/common/services/delisting.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export class DelistingService {
return this.httpClient.post<{ content: string }>(`${environment.API_HOST}/delisting/warnings/preview`, complianceNotice)
}

createComplianceNotice(complianceNotice: ComplianceNotice): Observable<void> {
return this.httpClient.post<void>(`${environment.API_HOST}/delisting/warnings`, complianceNotice)
createComplianceNotice(complianceNotice: ComplianceNotice): Observable<any> {
return this.httpClient.post<any>(`${environment.API_HOST}/delisting/warnings`, complianceNotice)
}

delistingRequestPreview(delistingRequest: ComplianceNotice): Observable<{ content: string }> {
return this.httpClient.post<{ content: string }>(`${environment.API_HOST}/delisting/requests/preview`, delistingRequest)
}

createDelistingRequest(delistingRequest: ComplianceNotice): Observable<void> {
return this.httpClient.post<void>(`${environment.API_HOST}/delisting/requests`, delistingRequest)
createDelistingRequest(delistingRequest: ComplianceNotice): Observable<any> {
return this.httpClient.post<any>(`${environment.API_HOST}/delisting/requests`, delistingRequest)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</div>
<div class="form-group-row-col">
<p-inputMask mask="(999) 999-9999" placeholder="(999) 999-9999" formControlName="LgContactPhone"
id="LgContactPhone" name="LgContactPhone">
inputId="LgContactPhone" name="LgContactPhone">
</p-inputMask>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DelistingService } from '../../../common/services/delisting.service';
import { DropdownOption } from '../../../common/models/dropdown-option';
import { DialogModule } from 'primeng/dialog';
import { ButtonModule } from 'primeng/button';
import { validateEmailListString, validatePhone, validateUrl } from '../../../common/consts/validators.const';
import { validateEmailListString, validateUrl } from '../../../common/consts/validators.const';
import { ToastModule } from 'primeng/toast';
import { MessageService } from 'primeng/api';
import { HttpErrorResponse } from '@angular/common/http';
Expand Down Expand Up @@ -71,6 +71,7 @@ export class ComplianceNoticeComponent implements OnInit {
onSubmit(comment: string): void {
if (this.myForm.valid) {
const model: ComplianceNotice = this.myForm.value;
model.ccList = this.myForm.value['ccList'].prototype === Array ? this.myForm.value : (this.myForm.value['ccList'] as string).split(',').filter(x => !!x).map(x => x.trim())
model.comment = comment;

this.delistingService.createComplianceNotice(model).subscribe({
Expand Down

0 comments on commit 5213deb

Please sign in to comment.