From: Bill Erickson Date: Fri, 10 Jan 2020 21:47:44 +0000 (-0500) Subject: LP1852782 Angular MARC record update API repairs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=abd661656a4d3308aca3aa5ed4a5f6a408322502;p=evergreen%2Fpines.git LP1852782 Angular MARC record update API repairs Use the correct API when updating authority records. Also use the correct bib record update API per LP 1859191. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts index 157ff0abc4..0bc308a6cc 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts @@ -220,7 +220,9 @@ export class MarcEditorComponent implements OnInit { } modifyRecord(marcXml: string, sourceName: string, sourceId: number): Promise { - const method = 'open-ils.cat.biblio.record.marc.replace'; + const method = this.recordType === 'biblio' ? + 'open-ils.cat.biblio.record.xml.update' : + 'open-ils.cat.authority.record.overlay'; return this.net.request('open-ils.cat', method, this.auth.token(), this.record.id, marcXml, sourceName @@ -235,7 +237,8 @@ export class MarcEditorComponent implements OnInit { return null; } - return response.marc(); + // authority.record.overlay resturns a '1' on success. + return typeof response === 'object' ? response.marc() : marcXml; }); }