[Groonga-commit] groonga/gcs-console [master] Fix to use withDomain function

Back to archive index

Yoji SHIDARA null+****@clear*****
Wed Oct 17 13:21:49 JST 2012


Yoji SHIDARA	2012-10-17 13:21:49 +0900 (Wed, 17 Oct 2012)

  New Revision: 7e0b2beaf1f9ebbad02d86e927d60da02bf6ad0d
  https://github.com/groonga/gcs-console/commit/7e0b2beaf1f9ebbad02d86e927d60da02bf6ad0d

  Log:
    Fix to use withDomain function

  Modified files:
    routes/index.js

  Modified: routes/index.js (+17 -16)
===================================================================
--- routes/index.js    2012-10-17 13:08:19 +0900 (65ab99e)
+++ routes/index.js    2012-10-17 13:21:49 +0900 (9372df4)
@@ -127,21 +127,22 @@ exports.domainCreatePost = function(req, res) {
 };
 
 exports.domainDelete = function(req, res) {
-  var domain = prepareCurrentDomain(req, res);
-  req.cloudsearch.DeleteDomain({
-    DomainName: domain.DomainName
-  }, function(error, data) {
-    if (error) {
-      // TODO redirect back domainCreate if it is a kind of validation error
-      // TODO render error in a more pretty way
-      // TODO in some cases, the error should be 400 rather than 500
-      res.status(500);
-      var message = JSON.stringify(error.Body.Response.Errors);
-      res.render('error', {message: message});
-      return;
-    }
-
-    res.redirect('/');
-    // TODO some feedback to user may be needed
+  withDomain(req, res, function(req, res) {
+    req.cloudsearch.DeleteDomain({
+      DomainName: req.domain.DomainName
+    }, function(error, data) {
+      if (error) {
+        // TODO redirect back domainCreate if it is a kind of validation error
+        // TODO render error in a more pretty way
+        // TODO in some cases, the error should be 400 rather than 500
+        res.status(500);
+        var message = JSON.stringify(error.Body.Response.Errors);
+        res.render('error', {message: message});
+        return;
+      }
+
+      res.redirect('/');
+      // TODO some feedback to user may be needed
+    });
   });
 };
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index