//
//  MenuSettingsRepository.swift
//  SodaLive
//
//  Created by klaus on 10/8/24.
//

import Foundation
import CombineMoya
import Combine
import Moya

final class MenuSettingsRepository {
    private let api = MoyaProvider<MenuApi>()
    
    func getAllMenuPreset(creatorId: Int) -> AnyPublisher<Response, MoyaError> {
        return api.requestPublisher(.getAllMenuPreset(creatorId: creatorId))
    }
    
    func saveMenu(menuId: Int, menu: String) -> AnyPublisher<Response, MoyaError> {
        return api.requestPublisher(.saveMenu(request: UpdateLiveMenuRequest(id: menuId, menu: menu)))
    }
}
