This repository was archived by the owner on Sep 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Add support for locale key injection #87
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9f1003d
Minor Swift 4 cleanup of WordPressComRestApi
sabaranski 72e7129
Modify WordPressComRestApi to support locale key injection
sabaranski 48749a1
Incremented Pods artifacts
sabaranski b96f6f4
Exposed anoymous API method with locale key
sabaranski fea283d
Separated v1 & v2 ActivityService endpoints
sabaranski 0469f41
Introduced additional documentation
sabaranski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
|
|
||
| @objc public class ActivityServiceRemote_ApiVersion1_0: ServiceRemoteWordPressComREST { | ||
|
|
||
| public enum ResponseError: Error { | ||
| case decodingFailure | ||
| } | ||
|
|
||
| /// Makes a request to Restore a site to a previous state. | ||
| /// | ||
| /// - Parameters: | ||
| /// - siteID: The target site's ID. | ||
| /// - rewindID: The rewindID to restore to. | ||
| /// - success: Closure to be executed on success | ||
| /// - failure: Closure to be executed on error. | ||
| /// | ||
| /// - Returns: A restoreID to check the status of the rewind request. | ||
| /// | ||
| @objc public func restoreSite(_ siteID: Int, | ||
| rewindID: String, | ||
| success: @escaping (_ restoreID: String) -> Void, | ||
| failure: @escaping (Error) -> Void) { | ||
| let endpoint = "activity-log/\(siteID)/rewind/to/\(rewindID)" | ||
| let path = self.path(forEndpoint: endpoint, withVersion: ._1_0) | ||
|
|
||
| wordPressComRestApi.POST(path, | ||
| parameters: nil, | ||
| success: { response, _ in | ||
| guard let restoreID = response["restore_id"] as? Int else { | ||
| failure(ResponseError.decodingFailure) | ||
| return | ||
| } | ||
| success(String(restoreID)) | ||
| }, | ||
| failure: { error, _ in | ||
| failure(error) | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.