feat(feat(init): serviceOfMachines):

This commit is contained in:
2024-03-26 16:03:24 +03:00
parent 6eb9973b61
commit f6ca446f92
22 changed files with 4644 additions and 458 deletions

View File

@@ -0,0 +1,24 @@
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