Skip to content

Commit

Permalink
Only fetch unlocked and non-hidden assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsansome committed May 2, 2018
1 parent caaa8dd commit afe1eaf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ios/Client.m
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,13 @@ - (void)getAssignmentsModifiedAfter:(NSString *)date
NSURLComponents *url =
[NSURLComponents componentsWithString:[NSString stringWithFormat:@"%s/assignments",
kURLBase]];
NSMutableArray<NSURLQueryItem *> *queryItems = [NSMutableArray array];
[queryItems addObject:[NSURLQueryItem queryItemWithName:@"unlocked" value:@"true"]];
[queryItems addObject:[NSURLQueryItem queryItemWithName:@"hidden" value:@"false"]];
if (date && date.length) {
[url setQueryItems:@[
[NSURLQueryItem queryItemWithName:@"updated_after" value:date],
]];
[queryItems addObject:[NSURLQueryItem queryItemWithName:@"updated_after" value:date]];
}
[url setQueryItems:queryItems];

[self startPagedQueryFor:url.URL handler:^(NSArray *data, NSError *error) {
if (error) {
Expand Down

0 comments on commit afe1eaf

Please sign in to comment.