Skip to content

Commit

Permalink
add new method to move folders
Browse files Browse the repository at this point in the history
  • Loading branch information
patricioxavier8 committed Nov 11, 2024
1 parent a966811 commit 65d98b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/InternxtSwiftCore/Services/HttpAPI/DriveAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ public struct DriveAPI {

return try await apiClient.fetch(type: MoveFolderResponse.self, endpoint, debugResponse: debug)
}

public func moveFolderNew(uuid: String,destinationFolder: String, debug: Bool = false) async throws -> MoveFolderResponseNew {
let endpoint = Endpoint(
path: "\(self.baseUrl)/folders/\(uuid)",
method: .PATCH,
body: MoveFilePayloadNew(
destinationFolder: destinationFolder

).toJson()
)

return try await apiClient.fetch(type: MoveFolderResponseNew.self, endpoint, debugResponse: debug)
}

public func deleteFolder(folderId: Int, debug: Bool = false) async throws -> Bool {
let endpoint = Endpoint(
Expand Down
2 changes: 2 additions & 0 deletions Sources/InternxtSwiftCore/Types/DriveTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ public struct MoveFolderResponse: Decodable {
public let moved: Bool
}

public struct MoveFolderResponseNew: Decodable {}


public struct GetLimitResponse: Decodable {
public let maxSpaceBytes: Int64
Expand Down

0 comments on commit 65d98b5

Please sign in to comment.