Subversion Repositories SmartDukaan

Rev

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

Rev 14004 Rev 14006
Line 26... Line 26...
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")
29
        string1 = req.get_param("searchMap")
30
        searchMap={}
30
        searchMap={}
-
 
31
        if string1 is None or string1 == "":
31
        try:
32
            try:
32
            if string1 is None or string1 == "":
33
                if string1 is None or string1 == "":
33
                searchMap = json.loads(string1, encoding='utf-8')
34
                    searchMap = json.loads(string1, encoding='utf-8')
34
        except:
35
            except:
35
            raise falcon.HTTPError(falcon.HTTP_400,
36
                raise falcon.HTTPError(falcon.HTTP_400,
36
                'Malformed JSON',
37
                    'Malformed JSON',
37
                'Could not decode the request body. The '
38
                    'Could not decode the request body. The '
38
                'JSON was incorrect.')
39
                    'JSON was incorrect.')
39
        result = Mongo.getMerchantOrdersByUser(int(userId), page, window, searchMap)
40
        result = Mongo.getMerchantOrdersByUser(int(userId), page, window, searchMap)
40
        resp.body = json.dumps(result, encoding='utf-8')
41
        resp.body = json.dumps(result, encoding='utf-8')
41
        
42
        
42
class Track():
43
class Track():
43
    def on_post(self, req, resp, userId):
44
    def on_post(self, req, resp, userId):