Skip to content

Commit 5b504d0

Browse files
committed
Update Package.swift
1 parent 976f035 commit 5b504d0

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ let package = Package(
1111
targets: [
1212
.binaryTarget(
1313
name: "WordPressKit",
14-
url: "https://github.com/user-attachments/files/19034191/WordPressKit.zip",
15-
checksum: "34f108cba86b5e4334d1c9af79946dbb8b665e270bdd14bc8f7bc0ba7a898583"
14+
url: "https://github.com/user-attachments/files/19303707/WordPressKit.zip",
15+
checksum: "ddc290d8d4b6163f277c76eed5fb486951ddf785b3ee07807fb8bb2f2ad410d1"
1616
),
1717
]
1818
)

Sources/WordPressKit/Models/RemoteBlog.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ import Foundation
5858
/// Blog's total disk quota space used.
5959
public var quotaSpaceUsed: NSNumber?
6060

61+
public var isDeleted: Bool
62+
6163
/// Parses details from a JSON dictionary, as returned by the WordPress.com REST API.
6264
@objc(initWithJSONDictionary:)
6365
public init(jsonDictionary json: NSDictionary) {
@@ -79,6 +81,7 @@ import Foundation
7981
self.planActiveFeatures = (json.array(forKeyPath: "plan.features.active") as? [String]) ?? []
8082
self.quotaSpaceAllowed = json.number(forKeyPath: "quota.space_allowed")
8183
self.quotaSpaceUsed = json.number(forKeyPath: "quota.space_used")
84+
self.isDeleted = json.number(forKey: "is_deleted")?.boolValue == true
8285
}
8386

8487
}

Sources/WordPressKit/Services/AccountServiceRemoteREST.m

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,6 @@ - (void)getBlogsWithParameters:(NSDictionary *)parameters
354354
{
355355
NSString *requestUrl = [self pathForEndpoint:@"me/sites"
356356
withVersion:WordPressComRESTAPIVersion_1_2];
357-
if (parameters[@"site_visibility"] == nil) {
358-
NSMutableDictionary *another = [parameters mutableCopy];
359-
another[@"site_visibility"] = @"visible";
360-
parameters = another;
361-
}
362357
[self.wordPressComRESTAPI get:requestUrl
363358
parameters:parameters
364359
success:^(id responseObject, NSHTTPURLResponse *httpResponse) {
@@ -390,10 +385,11 @@ - (RemoteUser *)remoteUserFromDictionary:(NSDictionary *)dictionary
390385
- (NSArray *)remoteBlogsFromJSONArray:(NSArray *)jsonBlogs
391386
{
392387
NSArray *blogs = jsonBlogs;
393-
return [blogs wpkit_map:^id(NSDictionary *jsonBlog) {
388+
return [[blogs wpkit_map:^id(NSDictionary *jsonBlog) {
394389
return [[RemoteBlog alloc] initWithJSONDictionary:jsonBlog];
390+
}] wpkit_filter:^BOOL(RemoteBlog *blog) {
391+
return !blog.isDeleted;
395392
}];
396-
return blogs;
397393
}
398394

399395
@end

0 commit comments

Comments
 (0)