LP1849212: allow call number change when course is at a system or consortium level
authorJane Sandberg <sandbej@linnbenton.edu>
Sat, 15 Aug 2020 02:56:11 +0000 (19:56 -0700)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 14 Sep 2020 22:17:23 +0000 (18:17 -0400)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/share/course.service.ts

index 2a81455..bc7f707 100644 (file)
@@ -210,15 +210,17 @@ export class CourseService {
         });
     }
 
-    updateItem(item: IdlObject, course_lib, call_number, updatingVolume) {
+
+    updateItem(item: IdlObject, courseLib, callNumber, updatingVolume) {
         return new Promise((resolve, reject) => {
             this.pcrud.update(item).subscribe(() => {
                 if (updatingVolume) {
                     const cn = item.call_number();
+                    const callNumberLibrary = this.org.canHaveVolumes(courseLib) ? courseLib : cn.owning_lib();
                     return this.net.request(
                         'open-ils.cat', 'open-ils.cat.call_number.find_or_create',
-                        this.auth.token(), call_number, cn.record(),
-                        course_lib, cn.prefix(), cn.suffix(),
+                        this.auth.token(), callNumber, cn.record(),
+                        callNumberLibrary, cn.prefix(), cn.suffix(),
                         cn.label_class()
                     ).subscribe(res => {
                         const event = this.evt.parse(res);