-
+
@@ -82,7 +82,7 @@
diff --git a/flatisfy/web/js_src/store/actions.js b/flatisfy/web/js_src/store/actions.js
index 3d7909a..7294570 100644
--- a/flatisfy/web/js_src/store/actions.js
+++ b/flatisfy/web/js_src/store/actions.js
@@ -27,6 +27,12 @@ export default {
commit(types.UPDATE_FLAT_STATUS, { flatId, newStatus })
})
},
+ updateFlatNotation ({ commit }, { flatId, newNotation }) {
+ commit(types.IS_LOADING)
+ api.updateFlatNotation(flatId, newNotation, response => {
+ commit(types.UPDATE_FLAT_NOTATION, { flatId, newNotation })
+ })
+ },
updateFlatNotes ({ commit }, { flatId, newNotes }) {
commit(types.IS_LOADING)
api.updateFlatNotes(flatId, newNotes, response => {
diff --git a/flatisfy/web/js_src/store/mutations-types.js b/flatisfy/web/js_src/store/mutations-types.js
index f7a2cb6..5336eee 100644
--- a/flatisfy/web/js_src/store/mutations-types.js
+++ b/flatisfy/web/js_src/store/mutations-types.js
@@ -2,5 +2,6 @@ export const REPLACE_FLATS = 'REPLACE_FLATS'
export const MERGE_FLATS = 'MERGE_FLATS'
export const UPDATE_FLAT_STATUS = 'UPDATE_FLAT_STATUS'
export const UPDATE_FLAT_NOTES = 'UPDATE_FLAT_NOTES'
+export const UPDATE_FLAT_NOTATION = 'UPDATE_FLAT_NOTATION'
export const RECEIVE_TIME_TO_PLACES = 'RECEIVE_TIME_TO_PLACES'
export const IS_LOADING = 'IS_LOADING'
diff --git a/flatisfy/web/js_src/store/mutations.js b/flatisfy/web/js_src/store/mutations.js
index 9cda85e..69d1559 100644
--- a/flatisfy/web/js_src/store/mutations.js
+++ b/flatisfy/web/js_src/store/mutations.js
@@ -39,6 +39,13 @@ export const mutations = {
Vue.set(state.flats[index], 'notes', newNotes)
}
},
+ [types.UPDATE_FLAT_NOTATION] (state, { flatId, newNotation }) {
+ state.loading = false
+ const index = state.flats.findIndex(flat => flat.id === flatId)
+ if (index > -1) {
+ Vue.set(state.flats[index], 'notation', newNotation)
+ }
+ },
[types.RECEIVE_TIME_TO_PLACES] (state, { timeToPlaces }) {
state.loading = false
state.timeToPlaces = timeToPlaces
diff --git a/flatisfy/web/js_src/tools/index.js b/flatisfy/web/js_src/tools/index.js
index 1b041c4..38fb58e 100644
--- a/flatisfy/web/js_src/tools/index.js
+++ b/flatisfy/web/js_src/tools/index.js
@@ -19,3 +19,7 @@ export function findFlatGPS (flat) {
export function capitalize (string) {
return string.charAt(0).toUpperCase() + string.slice(1)
}
+
+export function range (n) {
+ return [...Array(n).keys()]
+}
diff --git a/flatisfy/web/js_src/views/details.vue b/flatisfy/web/js_src/views/details.vue
index a1a784e..5af3ce2 100644
--- a/flatisfy/web/js_src/views/details.vue
+++ b/flatisfy/web/js_src/views/details.vue
@@ -136,17 +136,15 @@
|