Skip to content

Commit f201485

Browse files
committed
Fix mistakes with formatting
- "try await" was overlooked and forgotten about inside listAppPasswords. - Forgot to change createdAt's varaible to "var" instead of "let." - Fixed a grammar mistake in the documentation.
1 parent 823b948 commit f201485

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/ATProtoKit/Models/Lexicons/com.atproto/Server/AtprotoServerListAppPasswords.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
/// A data model definition of the of listing App Passwords.
1111
///
12-
/// - Note: According to the AT Protocol specifications: "List all App Passwords"
12+
/// - Note: According to the AT Protocol specifications: "List all App Passwords."
1313
///
1414
/// - SeeAlso: This is based on the [`com.atproto.server.listAppPasswords`][github] lexicon.
1515
///
@@ -28,7 +28,7 @@ public struct ServerAppPassword: Codable {
2828
/// The name associated with the App Password.
2929
public let name: String
3030
/// The date and date the App Password was created.
31-
@DateFormatting public let createdAt: Date
31+
@DateFormatting public var createdAt: Date
3232

3333
public init(name: String, createdAt: Date) {
3434
self.name = name

Sources/ATProtoKit/Networking/CoreAPI/ListAppPasswords.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ extension ATProtoKit {
1313
/// - Returns: A `Result`, containing either a ``ServerListAppPasswordsOutput`` if successful, or an `Error` if not.
1414
public func listAppPasswords() async throws -> Result<ServerListAppPasswordsOutput, Error> {
1515
guard let sessionURL = session.pdsURL,
16-
let requestURL = URL(string: "\(requestURL)/xrpc/com.atproto.server.listAppPasswords") else {
16+
let requestURL = URL(string: "\(sessionURL)/xrpc/com.atproto.server.listAppPasswords") else {
1717
return .failure(NSError(domain: "", code: -1, userInfo: [NSLocalizedDescriptionKey : "Invalid URL"]))
1818
}
1919

2020
do {
2121
let request = APIClientService.createRequest(forRequest: requestURL, andMethod: .get, acceptValue: "application/json", contentTypeValue: nil, authorizationValue: "Bearer \(session.accessToken)")
22-
let response = APIClientService.sendRequest(request, decodeTo: ServerListAppPasswordsOutput.self)
22+
let response = try await APIClientService.sendRequest(request, decodeTo: ServerListAppPasswordsOutput.self)
2323

2424
return .success(response)
2525
} catch {

0 commit comments

Comments
 (0)