Skip to content

Commit

Permalink
filter expenses by category
Browse files Browse the repository at this point in the history
  • Loading branch information
xdamman committed Feb 20, 2018
1 parent c969488 commit 3f6f8e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/graphql/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,14 @@ const queries = {
CollectiveId: { type: new GraphQLNonNull(GraphQLInt) },
includeHostedCollectives: { type: GraphQLBoolean },
status: { type: GraphQLString },
category: { type: GraphQLString },
limit: { type: GraphQLInt },
offset: { type: GraphQLInt }
},
resolve(_, args, req) {
const query = { where: {} };
if (args.status) query.where.status = args.status;
if (args.category) query.where.category = { $iLike: args.category };
if (args.limit) query.limit = args.limit;
if (args.offset) query.offset = args.offset;
query.order = [["incurredAt", "DESC"]];
Expand Down

0 comments on commit 3f6f8e4

Please sign in to comment.