Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
MOBILESDK-20 - LRJSONObjectWrapper parameters weren't correctly being…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
Bruno Farache committed May 16, 2014
1 parent 9810ea0 commit fa5eaef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public void addBookmarkEntry() throws Exception {

JSONObject jsonObject = new JSONObject();
jsonObject.put("uuid", uuid);
jsonObject.put("addGroupPermissions", true);
jsonObject.put("addGuestPermissions", true);
JSONObjectWrapper serviceContext = new JSONObjectWrapper(jsonObject);

JSONObject entry = addBookmarkEntry("test", serviceContext);
Expand Down
4 changes: 2 additions & 2 deletions ios/Source/Core/LRJSONObjectWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ - (void)_addJSONObjectWithParams:(NSMutableDictionary *)params
name:(NSString *)name {

for (NSString *key in self.jsonObject) {
name = [NSString stringWithFormat:@"%@.%@", name, key];
NSString *paramKey = [NSString stringWithFormat:@"%@.%@", name, key];
id value = [self.jsonObject objectForKey:key];

[params setObject:value forKey:name];
[params setObject:value forKey:paramKey];
}
}

Expand Down
4 changes: 3 additions & 1 deletion ios/Test/Portal/ServiceContextTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ - (void)testAddBookmarkEntry {
NSString *uuid = [[NSUUID UUID] UUIDString];

NSDictionary *jsonObject = @{
@"uuid": uuid
@"uuid": uuid,
@"addGroupPermissions": @(YES),
@"addGuestPermissions":@(YES)
};

LRJSONObjectWrapper *serviceContext = [[LRJSONObjectWrapper alloc]
Expand Down

0 comments on commit fa5eaef

Please sign in to comment.