Rename parameter account to account_id.
This commit is contained in:
parent
e4c0752a2c
commit
f961eba9bf
@ -60,7 +60,7 @@ parser.add_argument('canceled', type=bool)
|
||||
|
||||
|
||||
range_parser = reqparse.RequestParser()
|
||||
range_parser.add_argument('account', type=int)
|
||||
range_parser.add_argument('account_id', type=int)
|
||||
range_parser.add_argument('begin', type=lambda a: dateutil.parser.parse(a))
|
||||
range_parser.add_argument('end', type=lambda a: dateutil.parser.parse(a))
|
||||
|
||||
@ -75,7 +75,7 @@ class OperationListResource(Resource):
|
||||
begin=data['begin'],
|
||||
end=data['end'],
|
||||
).filter(
|
||||
Operation.account_id == data['account']
|
||||
Operation.account_id == data['account_id']
|
||||
).all(), 200
|
||||
|
||||
@requires_auth
|
||||
|
@ -59,7 +59,7 @@ parser.add_argument('account_id', type=int)
|
||||
|
||||
|
||||
get_parser = reqparse.RequestParser()
|
||||
get_parser.add_argument('account', type=int)
|
||||
get_parser.add_argument('account_id', type=int)
|
||||
|
||||
|
||||
class ScheduledOperationListResource(Resource):
|
||||
@ -71,9 +71,7 @@ class ScheduledOperationListResource(Resource):
|
||||
"""
|
||||
data = get_parser.parse_args()
|
||||
|
||||
return ScheduledOperation.query().filter(
|
||||
ScheduledOperation.account_id == data.account
|
||||
).all(), 200
|
||||
return ScheduledOperation.query().filter_by(**data).all(), 200
|
||||
|
||||
@requires_auth
|
||||
@marshal_with_field(Object(scheduled_operation_model))
|
||||
|
@ -354,7 +354,7 @@ accountantApp
|
||||
*/
|
||||
$scope.load = function(begin, end) {
|
||||
$scope.operations = Operation.query({
|
||||
account: $routeParams.accountId,
|
||||
account_id: $routeParams.accountId,
|
||||
begin: begin.format('YYYY-MM-DD'),
|
||||
end: end.format('YYYY-MM-DD')
|
||||
});
|
||||
|
@ -48,7 +48,7 @@ accountantApp
|
||||
*/
|
||||
$scope.load = function() {
|
||||
$scope.operations = ScheduledOperation.query({
|
||||
account: $routeParams.accountId
|
||||
account_id: $routeParams.accountId
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user