Skip to content

Commit

Permalink
refact: code refactoring in FavoriteService
Browse files Browse the repository at this point in the history
  • Loading branch information
makinosp committed Oct 5, 2024
1 parent 1d8dbcd commit 9cadda5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Sources/VRCKit/Services/FavoriteService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public final actor FavoriteService: APIService, FavoriteServiceProtocol {
userId: String,
tag: String
) async throws -> SuccessResponse {
let paths = ["favorite", "groups", type.rawValue, displayName, userId]
let path = paths.joined(separator: "/")
let pathParams = ["favorite", "groups", type.rawValue, displayName, userId]
let path = pathParams.joined(separator: "/")
let requestData = try await Serializer.shared.encode(
RequestToUpdateFavoriteGroup(displayName: displayName, visibility: visibility, tags: [tag])
)
Expand All @@ -111,9 +111,7 @@ public final actor FavoriteService: APIService, FavoriteServiceProtocol {
/// Asynchronously remove favorite.
/// - Parameter favoriteId: The ID of the favorite to remove.
/// - Returns: A `SuccessResponse` objects.
public func removeFavorite(
favoriteId: String
) async throws -> SuccessResponse {
public func removeFavorite(favoriteId: String) async throws -> SuccessResponse {
let path = "favorites/\(favoriteId)"
let response = try await client.request(path: path, method: .delete)
return try await Serializer.shared.decode(response.data)
Expand Down

0 comments on commit 9cadda5

Please sign in to comment.