Implemented the GetDataUseCase use case for the Browse module.

This commit is contained in:
Javier Cicchelli 2022-12-16 01:47:06 +01:00
parent 0cb5510539
commit 745ba87fb5

View File

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