Skip to content

Commit

Permalink
Add Reasons-Array to listNotifications parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mfreiwald committed Jan 18, 2025
1 parent 3ef47f9 commit 561304e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension ATProtoKit {
/// - Throws: An ``ATProtoError``-conforming error type, depending on the issue. Go to
/// ``ATAPIError`` and ``ATRequestPrepareError`` for more details.
public func listNotifications(
with reason: String? = nil,
with reasons: [AppBskyLexicon.Notification.Notification.Reason]? = nil,
limit: Int? = 50,
isPriority: Bool?,
cursor: String? = nil,
Expand All @@ -50,8 +50,10 @@ extension ATProtoKit {

var queryItems = [(String, String)]()

if let reason {
queryItems.append(("reason", "\(reason)"))
if let reasons {
reasons.forEach { reason in
queryItems.append(("reasons[]", "\(reason.rawValue)"))
}
}

if let limit {
Expand Down

0 comments on commit 561304e

Please sign in to comment.