Parcourir la Source

Fix error code when trying to kick a user that is not in the society

Matt Coles il y a 9 ans
Parent
commit
5a0514abbf
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. 8 1
      presenters/society-controller.js

+ 8 - 1
presenters/society-controller.js

@@ -200,7 +200,14 @@ module.exports = {
200 200
                   "error": 3
201 201
                 });
202 202
               } else {
203
-                self.leave_society(soc_name, result["auth-key"], complete);
203
+                self.leave_society(soc_name, result["auth-key"], function (response) {
204
+                  if (response.error === 1) {
205
+                    response.error = 2;
206
+                    complete(response);
207
+                  } else {
208
+                    complete(response);
209
+                  }
210
+                });
204 211
               }
205 212
             });
206 213
           } else {