//
//  ReportApi.swift
//  SodaLive
//
//  Created by klaus on 2023/08/11.
//

import Foundation
import Moya

enum ReportApi {
    case report(request: ReportRequest)
}

extension ReportApi: TargetType {
    var baseURL: URL {
        return URL(string: BASE_URL)!
    }
    
    var path: String {
        switch self {
        case .report:
            return "/report"
        }
    }
    
    var method: Moya.Method {
        switch self {
        case .report:
            return .post
        }
    }
    
    var task: Task {
        switch self {
        case .report(let request):
            return .requestJSONEncodable(request)
        }
    }
    
    var headers: [String : String]? {
        return ["Authorization": "Bearer \(UserDefaults.string(forKey: UserDefaultsKey.token))"]
    }
}
