@@ -16,6 +16,11 @@ public protocol InboxNotesRemoteProtocol {
1616 func dismissInboxNote( for siteID: Int64 ,
1717 noteID: Int64 ,
1818 completion: @escaping ( Result < InboxNote , Error > ) -> ( ) )
19+
20+ func markInboxNoteAsActioned( for siteID: Int64 ,
21+ noteID: Int64 ,
22+ actionID: Int64 ,
23+ completion: @escaping ( Result < InboxNote , Error > ) -> ( ) )
1924}
2025
2126
@@ -75,7 +80,7 @@ public final class InboxNotesRemote: Remote, InboxNotesRemoteProtocol {
7580 /// This internally marks a notification’s is_deleted field to true and such notifications do not show in the results anymore.
7681 ///
7782 /// - Parameters:
78- /// - siteID: The site for which we'll fetch InboxNotes .
83+ /// - siteID: The site for which we'll dismiss the InboxNote .
7984 /// - noteID: The ID of the note that should be marked as dismissed.
8085 /// - completion: Closure to be executed upon completion.
8186 ///
@@ -93,6 +98,33 @@ public final class InboxNotesRemote: Remote, InboxNotesRemoteProtocol {
9398
9499 enqueue ( request, mapper: mapper, completion: completion)
95100 }
101+
102+ // MARK: - Set Inbox Note as `actioned`
103+
104+ /// Set an `InboxNote` as `actioned`.
105+ /// This internally marks a notification’s status as `actioned`.
106+ ///
107+ /// - Parameters:
108+ /// - siteID: The site for which we'll mark the InboxNote as actioned.
109+ /// - noteID: The ID of the note.
110+ /// - actionID: The ID of the action.
111+ /// - completion: Closure to be executed upon completion.
112+ ///
113+ public func markInboxNoteAsActioned( for siteID: Int64 ,
114+ noteID: Int64 ,
115+ actionID: Int64 ,
116+ completion: @escaping ( Result < InboxNote , Error > ) -> ( ) ) {
117+
118+ let request = JetpackRequest ( wooApiVersion: . wcAnalytics,
119+ method: . post,
120+ siteID: siteID,
121+ path: Path . notes + " / \( noteID) /action/ \( actionID) " ,
122+ parameters: nil )
123+
124+ let mapper = InboxNoteMapper ( siteID: siteID)
125+
126+ enqueue ( request, mapper: mapper, completion: completion)
127+ }
96128}
97129
98130// MARK: - Constants
@@ -106,7 +138,6 @@ public extension InboxNotesRemote {
106138
107139 private enum Path {
108140 static let notes = " admin/notes "
109- static let deleteNote = " admin/notes/delete "
110141 }
111142
112143 private enum ParameterKey {
0 commit comments