Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit d863cba

Browse files
committed
Fix RemotePostUpdateParameters diff for empty strings
1 parent 6a3b5c8 commit d863cba

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Sources/WordPressKit/Models/RemotePostParameters.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,20 @@ extension RemotePostCreateParameters {
7171
if previous.authorID != authorID {
7272
changes.authorID = authorID
7373
}
74-
if previous.title != title {
75-
changes.title = title
74+
if (previous.title ?? "") != (title ?? "") {
75+
changes.title = (title ?? "")
7676
}
77-
if previous.content != content {
78-
changes.content = content
77+
if (previous.content ?? "") != (content ?? "") {
78+
changes.content = (content ?? "")
7979
}
8080
if previous.password != password {
8181
changes.password = password
8282
}
83-
if previous.excerpt != excerpt {
84-
changes.excerpt = excerpt
83+
if (previous.excerpt ?? "") != (excerpt ?? "") {
84+
changes.excerpt = (excerpt ?? "")
8585
}
86-
if previous.slug != slug {
87-
changes.slug = slug
86+
if (previous.slug ?? "") != (slug ?? "") {
87+
changes.slug = (slug ?? "")
8888
}
8989
if previous.featuredImageID != featuredImageID {
9090
changes.featuredImageID = featuredImageID

0 commit comments

Comments
 (0)