37 lines
709 B
Swift
37 lines
709 B
Swift
//
|
|
// GetDataUseCase.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
|
|
import Foundation
|
|
|
|
struct GetDataUseCase {
|
|
|
|
// MARK: Dependencies
|
|
|
|
@Dependency(\.apiService) private var apiService
|
|
|
|
// MARK: Functions
|
|
|
|
func callAsFunction(
|
|
id: String,
|
|
username: String,
|
|
password: String
|
|
) async throws -> Data {
|
|
return try await apiService.getData(
|
|
id: id,
|
|
credentials: .init(
|
|
username: username,
|
|
password: password
|
|
)
|
|
)
|
|
}
|
|
|
|
}
|