Created
August 26, 2014 16:30
-
-
Save lefnire/5143c15246f6b5a0d7d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/script/index.coffee b/script/index.coffee | |
index 4f56d19..f81fd44 100644 | |
--- a/script/index.coffee | |
+++ b/script/index.coffee | |
@@ -507,6 +507,7 @@ api.wrap = (user, main=true) -> | |
sortTask: (req, cb) -> | |
{id} = req.params | |
{to, from} = req.query | |
+ return cb?() if to is from | |
task = user.tasks[id] | |
return cb?({code:404, message: i18n.t('messageTaskNotFound', req.language)}) unless task | |
return cb?('?to=__&from=__ are required') unless to? and from? | |
@@ -550,6 +551,7 @@ api.wrap = (user, main=true) -> | |
sortTag: (req, cb) -> | |
{to, from} = req.query | |
+ return cb?(null) if to is from | |
return cb?('?to=__&from=__ are required') unless to? and from? | |
user.tags.splice to, 0, user.tags.splice(from, 1)[0] | |
cb? null, user.tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment