Skip to content

Commit

Permalink
Do not ask to delete an object if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
ipodishima committed Feb 27, 2016
1 parent de3cb7d commit 9093f61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Files/WAMappingManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ - (NSDictionary *)mapObject:(id)object forPath:(NSString *)path method:(WAObject
}

- (void)deleteObjectFromStore:(id)object fromRequest:(WAObjectRequest *)request {
if (!object) {
return;
}

BOOL shouldDelete = NO;
if (request.method & WAObjectRequestMethodDELETE) {
shouldDelete = YES;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ If you write
}];
```

This will automatically delete enterprise from the store on success!
This will automatically delete enterprise from the store on success! Be careful that if you delete an object only from it's ressource, it's up to you to delete it from your store (`[routingManager deleteObject:nil path:@"enterprises/1"...]`).

## Get the HTTP code and header fields from the response

Expand Down

0 comments on commit 9093f61

Please sign in to comment.