Implemented the CreateFolderUseCase use case for the Browse module.

This commit is contained in:
Javier Cicchelli 2022-12-17 00:03:30 +01:00
parent 120356bf8e
commit e66b027c66

View File

@ -0,0 +1,47 @@
//
// 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)
}
}