feat(feat(init): serviceOfMachines):
This commit is contained in:
24
live_monitor_vue/src/services/ServiceOfMachines.js
Normal file
24
live_monitor_vue/src/services/ServiceOfMachines.js
Normal 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
|
||||
Reference in New Issue
Block a user