Skip to content

Commit 394a320

Browse files
committed
AccountRemote: New loadSites API
1 parent f421cae commit 394a320

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Networking/Networking/Remote/AccountRemote.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,19 @@ public class AccountRemote: Remote {
1515

1616
enqueue(request, mapper: mapper, completion: completion)
1717
}
18+
19+
20+
/// Loads the Sites collection associated with the WordPress.com User.
21+
///
22+
public func loadSites(completion: @escaping ([Site]?, Error?) -> Void) {
23+
let path = "me/sites"
24+
let parameters = [
25+
"fields": "ID,name,description,URL,options"
26+
]
27+
28+
let request = DotcomRequest(wordpressApiVersion: .mark1_1, method: .get, path: path, parameters: parameters)
29+
let mapper = SiteListMapper()
30+
31+
enqueue(request, mapper: mapper, completion: completion)
32+
}
1833
}

0 commit comments

Comments
 (0)