48 lines
896 B
Swift
48 lines
896 B
Swift
//
|
|
// CreateFolderUseCase.swift
|
|
// Browse
|
|
//
|
|
// Created by Javier Cicchelli on 16/12/2022.
|
|
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
|
//
|
|
|
|
import APIService
|
|
import DependencyInjection
|
|
import Dependencies
|
|
|
|
struct CreateFolderUseCase {
|
|
|
|
// MARK: Properties
|
|
|
|
let apiService: APIService
|
|
|
|
// MARK: Functions
|
|
|
|
func callAsFunction(
|
|
id: String,
|
|
name: String,
|
|
username: String,
|
|
password: String
|
|
) async throws {
|
|
_ = try await apiService.createFolder(
|
|
id: id,
|
|
name: name,
|
|
credentials: .init(
|
|
username: username,
|
|
password: password
|
|
)
|
|
)
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - Initialisers
|
|
|
|
extension CreateFolderUseCase {
|
|
init() {
|
|
@Dependency(\.apiService) var apiService
|
|
|
|
self.init(apiService: apiService)
|
|
}
|
|
}
|