Skip to content
Snippets Groups Projects
Unverified Commit 9cfb61ee authored by Marc Hanisch's avatar Marc Hanisch
Browse files

adds the new CustomTextField to the fields array and sets the edit route

parent b3923335
No related branches found
No related tags found
2 merge requests!90Draft: restructure frontend properties 2,!82Restructure frontend
...@@ -90,9 +90,10 @@ export default class DeviceCustomFieldsPage extends Vue { ...@@ -90,9 +90,10 @@ export default class DeviceCustomFieldsPage extends Vue {
addField (): void { addField (): void {
const field = new CustomTextField() const field = new CustomTextField()
this.isSaving = true this.isSaving = true
this.$api.customfields.add(this.deviceId, field).then(() => { this.$api.customfields.add(this.deviceId, field).then((newField: CustomTextField) => {
this.isSaving = false this.isSaving = false
this.$router.push('/devices/' + this.deviceId + '/customfields') this.customFields.push(newField)
this.$router.push('/devices/' + this.deviceId + '/customfields/' + newField.id + '/edit')
}).catch(() => { }).catch(() => {
this.isSaving = false this.isSaving = false
this.$store.commit('snackbar/setError', 'Failed to save custom field') this.$store.commit('snackbar/setError', 'Failed to save custom field')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment