
class ServiceOfMachines {
  constructor(adapter, store) {
    this.adapter = adapter
    this.store = store
  }

  async fetchModalMachines() {
    return await this.adapter.getModalMachines()
  }

  async putModalMachines(machines) {
    const result = await this.store.dispatch('machines/saveModalMachines', machines)
    return result
  }

  async makeFetchAndPutModalMachines() {
    const machines = await this.fetchModalMachines()
    await this.putModalMachines(machines)
    return machines
  }
}

export default ServiceOfMachines