Skip to content

Commit f383f65

Browse files
committed
refact: update doc of UserServiceProtocol
1 parent 7a8f64e commit f383f65

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Sources/VRCKit/Protocols/UserServiceProtocol.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
//
77

88
public protocol UserServiceProtocol: Sendable {
9+
/// Fetches detailed information about a specific user.
10+
/// - Parameter userId: The ID of the user to retrieve.
11+
/// - Returns: A `UserDetail` object containing detailed information about the specified user.
12+
/// - Throws: An error if the request fails or decoding is unsuccessful.
913
func fetchUser(userId: String) async throws -> UserDetail
14+
15+
/// Updates the information for a specific user.
16+
/// - Parameters:
17+
/// - id: The ID of the user to update.
18+
/// - editedInfo: An `EditableUserInfo` object containing the updated user information.
19+
/// - Throws: An error if the request fails or encoding is unsuccessful.
1020
func updateUser(id: String, editedInfo: EditableUserInfo) async throws
1121
}

Sources/VRCKit/Services/UserService.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ public final actor UserService: APIService, UserServiceProtocol {
1212
public let client: APIClient
1313
private let path = "users"
1414

15-
/// Fetch a user
1615
public func fetchUser(userId: String) async throws -> UserDetail {
1716
let response = try await client.request(path: "\(path)/\(userId)", method: .get)
1817
return try Serializer.shared.decode(response.data)
1918
}
2019

21-
/// Update user
2220
public func updateUser(id: String, editedInfo: EditableUserInfo) async throws {
2321
let requestData = try Serializer.shared.encode(editedInfo)
2422
_ = try await client.request(

0 commit comments

Comments
 (0)