Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

week.js 546B

123456789101112131415161718192021222324252627
  1. /* eslint-disable prefer-destructuring */
  2. /* eslint-disable no-restricted-syntax */
  3. /* eslint-disable guard-for-in */
  4. import axios from 'axios';
  5. export default {
  6. namespaced: true,
  7. state: {
  8. week: undefined,
  9. },
  10. mutations: {
  11. setWeek(state, week) {
  12. if (week.length > 0) {
  13. state.week = week[0];
  14. }
  15. },
  16. },
  17. getters: {},
  18. actions: {
  19. initWeek({
  20. commit,
  21. }, weekId) {
  22. axios.get(`/api/timeshareweek/${weekId}`).then(r => commit('setWeek', r.data)).catch(console
  23. .error);
  24. },
  25. },
  26. };