fix survey JS for the new PermaCrud CUD semantics in the oncomplete handler
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 2 Feb 2010 21:56:21 +0000 (21:56 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 2 Feb 2010 21:56:21 +0000 (21:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15437 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/conify/global/action/survey.js
Open-ILS/web/js/ui/default/conify/global/action/survey/edit.js

index 5fb779b..c980965 100644 (file)
@@ -145,8 +145,8 @@ function svCreate(args) {
     var pcrud = new openils.PermaCrud();
     pcrud.create(sv,
                  {           
-                     oncomplete: function(r) {
-                         var obj = openils.Util.readResponse(r);
+                     oncomplete: function(r, objs) {
+                         var obj = objs[0];
                          if(!obj) return '';
                          svGrid.store.newItem(asv.toStoreItem(obj));
                          svSurveyDialog.hide();
index 2c2b8ed..132c3fc 100644 (file)
@@ -123,8 +123,8 @@ function newQuestion(svyId, questionText, questionRow) {
     question.question(questionText);
     question.isnew(true);
     pcrud.create(question, 
-        {oncomplete: function(r) 
-             { var q = openils.Util.readResponse(r); 
+        {oncomplete: function(r, qs
+             { var q = qs[0];
                  questionRow.parentNode.removeChild(questionRow);
                  drawQuestionBody(q, null);
                  newQuestionBody(svyId);