mirror of
https://github.com/mokuappio/serverless-invoices.git
synced 2025-10-28 16:31:07 -04:00
Abstract footer to separate component. Abstract logo to separate component. Be able to edit team in modal. Add custom fields to team. Removed vat and reg no from team (replaced by custom fields). Custom fields are also stored on the invoice. When creating invoice add team custom fields to invoice as well. Be able to set default invoice due date, late fee, vat rate and currency.
This commit is contained in:
31
src/store/team-fields.js
Normal file
31
src/store/team-fields.js
Normal file
@ -0,0 +1,31 @@
|
||||
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 });
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user