block-employee-directory-in.../EmployeeDirectory/Services/EmployeeService.swift
Matt Bruce a517ced1cc initial protocol and implementation
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
2025-01-20 17:23:07 -06:00

20 lines
538 B
Swift

//
// EmployeeService.swift
// EmployeeDirectory
//
// Created by Matt Bruce on 1/20/25.
//
import Foundation
/// Service Layer for Employees
public class EmployeeService: EmployeeServiceProtocol {
/// Service to get Employees
/// - Returns: Array of Employee Structs
public func getEmployees() async throws -> [Employee] {
let employees: Employees = try await NetworkService.shared.fetchData(from: "https://jsonplaceholder.typicode.com/users", as: Employees.self)
return employees.employees
}
}