mirror of
https://github.com/mokuappio/serverless-invoices.git
synced 2025-10-27 16:01:07 -04:00
32 lines
814 B
JavaScript
32 lines
814 B
JavaScript
import TeamField from '@/store/models/team-field';
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state: {},
|
|
mutations: {},
|
|
actions: {
|
|
init() {},
|
|
terminate() {},
|
|
async teamFieldProps(store, payload) {
|
|
return TeamField.update({
|
|
where: payload.fieldId,
|
|
data: payload.props,
|
|
});
|
|
},
|
|
async updateTeamField({ dispatch }, payload) {
|
|
await dispatch('teamFieldProps', payload);
|
|
return dispatch('teams/updateTeam', null, { root: true });
|
|
},
|
|
async addNewField(store, teamId) {
|
|
const field = await TeamField.createNew();
|
|
field.$update({
|
|
team_id: teamId,
|
|
});
|
|
},
|
|
async deleteTeamField({ dispatch }, fieldId) {
|
|
await TeamField.delete(fieldId);
|
|
return dispatch('teams/updateTeam', null, { root: true });
|
|
},
|
|
},
|
|
};
|