Subversion Repositories SmartDukaan

Rev

Rev 13990 | Rev 14004 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13990 Rev 14003
Line 24... Line 24...
24
        resp.body = json.dumps(result, encoding='utf-8')
24
        resp.body = json.dumps(result, encoding='utf-8')
25
    
25
    
26
    def on_get(self, req, resp, userId):
26
    def on_get(self, req, resp, userId):
27
        page = req.get_param_as_int("page")
27
        page = req.get_param_as_int("page")
28
        window = req.get_param_as_int("window")
28
        window = req.get_param_as_int("window")
-
 
29
        string1 = req.get_param("searchMap")
-
 
30
        try:
-
 
31
            if string1 is None or string1 == "":
-
 
32
                searchMap = json.loads(string1, encoding='utf-8')
-
 
33
        except:
-
 
34
            raise falcon.HTTPError(falcon.HTTP_400,
-
 
35
                'Malformed JSON',
-
 
36
                'Could not decode the request body. The '
-
 
37
                'JSON was incorrect.')
29
        result = Mongo.getMerchantOrdersByUser(int(userId), page, window)
38
        result = Mongo.getMerchantOrdersByUser(int(userId), page, window, searchMap)
30
        resp.body = json.dumps(result, encoding='utf-8')
39
        resp.body = json.dumps(result, encoding='utf-8')
31
        
40
        
32
class Track():
41
class Track():
33
    def on_post(self, req, resp, userId):
42
    def on_post(self, req, resp, userId):
34
        try:
43
        try: