From 7af1dd1720e817ab8948d406157d1a85d6e709c9 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Wed, 13 Nov 2024 08:22:55 -0500 Subject: [PATCH] import --- .../admin/src/app/talkgroups/import/import.component.html | 1 + client/admin/src/app/talkgroups/import/import.component.ts | 4 +++- client/admin/src/app/talkgroups/talkgroups.service.ts | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/admin/src/app/talkgroups/import/import.component.html b/client/admin/src/app/talkgroups/import/import.component.html index 3e1c15e..2b82444 100644 --- a/client/admin/src/app/talkgroups/import/import.component.html +++ b/client/admin/src/app/talkgroups/import/import.component.html @@ -6,6 +6,7 @@ placeholder="Paste RadioReference page here" formControlName="contents" > + diff --git a/client/admin/src/app/talkgroups/import/import.component.ts b/client/admin/src/app/talkgroups/import/import.component.ts index 8a9c0ba..9c5a7df 100644 --- a/client/admin/src/app/talkgroups/import/import.component.ts +++ b/client/admin/src/app/talkgroups/import/import.component.ts @@ -26,11 +26,13 @@ export class ImportComponent { ngOnInit() { this.form = new FormGroup({ contents: new FormControl(''), + systemID: new FormControl(0), }); } submit() { let content = this.form.controls['contents'].value; - this.tgService.importRR(content) + let sysID = Number(this.form.controls['systemID'].value); + this.tgService.importRR(sysID, content) .pipe( catchError(() => { return of(null); diff --git a/client/admin/src/app/talkgroups/talkgroups.service.ts b/client/admin/src/app/talkgroups/talkgroups.service.ts index 1b8822a..80fbdc3 100644 --- a/client/admin/src/app/talkgroups/talkgroups.service.ts +++ b/client/admin/src/app/talkgroups/talkgroups.service.ts @@ -18,9 +18,9 @@ export class TalkgroupService { return this.http.get(`/api/talkgroup/${sys}/${tg}`); } - importRR(content: string): Observable { - return this.http.put('/api/talkgroup/import', - {type: 'radioreference', body: content}); + importRR(sysID: number, content: string): Observable { + return this.http.post('/api/talkgroup/import', + {systemID: sysID, type: 'radioreference', body: content}); } putTalkgroup(tu: TalkgroupUpdate): Observable {