]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/PathController.php
revert a86eeac0ab678ea55307e1386c5f955f77d8ff73
[syj.git] / application / controllers / PathController.php
index aa41866679103703bb66909032302ecd59fd645d..bb969e82c8ed6b15888a6cf9de01adc0510c7a4e 100644 (file)
@@ -15,19 +15,23 @@ class PathController extends Zend_Controller_Action
         $path->creator = $user;
         $path->creatorIp = $this->getRequest()->getClientIp(true);
 
-        return $this->save($path, $formData);
+        $this->save($path, $formData);
+        $data = array('redirect' => "idx/" . (string)$path->id);
+        $this->_helper->SyjApi->setCode(201)->setBodyJson($data);
     }
 
     public function updateAction() {
         $formData = $this->_helper->SyjPostData->getPostData('Syj_Form_Geom');
-        return $this->save($this->getPath(), $formData);
+        $path = $this->getPath();
+        $this->save($path, $formData);
+        $this->_helper->SyjApi->setCode(200); // we should use 204, but ie mangles 204 to 1223
     }
 
     public function deleteAction() {
         $path = $this->getPath();
         $pathMapper = new Syj_Model_PathMapper();
         $pathMapper->delete ($path);
-        $this->_helper->SyjApi->setCode(204);
+        $this->_helper->SyjApi->setCode(200); // we should use 204, but ie mangles 204 to 1223
     }
 
     public function getPath() {
@@ -84,8 +88,6 @@ class PathController extends Zend_Controller_Action
                 throw $e;
             }
         }
-
-        $this->_helper->SyjApi->setBody($path->id);
     }
 
 }