Skip to content

Commit

Permalink
Merge pull request #95 from mfreiwald/listNotifications-Reasons
Browse files Browse the repository at this point in the history
Add Reasons-Array to listNotifications parameter
  • Loading branch information
MasterJ93 authored Jan 18, 2025
2 parents de606cd + 561304e commit 6fb3bc5
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 6fb3bc5

Please sign in to comment.