Flatten nested repos
This commit is contained in:
28
test/vuex/one-mapping-batch-v2/modules/staff.js
Normal file
28
test/vuex/one-mapping-batch-v2/modules/staff.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import * as api from "../api/staff.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
selected_staff: {},
|
||||
},
|
||||
mutations: {
|
||||
update_selected_staff(state,data) {
|
||||
state.selected_staff= data
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context,prm) {
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status == "OK") {
|
||||
let data = resp.data.records
|
||||
console.log(data)
|
||||
context.commit("update_selected_staff",data)
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user