You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
530 B

2 years ago
2 years ago
2 years ago
  1. export const state = () => ({
  2. current: {}
  3. })
  4. export const getters = {
  5. currentProject(state) {
  6. return state.current
  7. },
  8. project(state) {
  9. return state.current
  10. }
  11. }
  12. export const mutations = {
  13. setCurrent(state, payload) {
  14. state.current = payload
  15. }
  16. }
  17. export const actions = {
  18. async setCurrentProject({ commit }, projectId) {
  19. try {
  20. const project = await this.$services.project.findById(projectId)
  21. commit('setCurrent', project)
  22. } catch (error) {
  23. throw new Error(error)
  24. }
  25. }
  26. }