From 5335ed6de65fe3aaa0875523dcc9295f90bfc7ed Mon Sep 17 00:00:00 2001 From: zhuojie Date: Mon, 16 Mar 2020 17:12:10 -0700 Subject: [PATCH] Fix json attachment validation --- browser/flagr-ui/src/components/Flag.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/browser/flagr-ui/src/components/Flag.vue b/browser/flagr-ui/src/components/Flag.vue index fac7f401..e559db4e 100644 --- a/browser/flagr-ui/src/components/Flag.vue +++ b/browser/flagr-ui/src/components/Flag.vue @@ -248,6 +248,8 @@ v-model="variant.attachment" :showBtns="false" :mode="'code'" + v-on:has-error="variant.attachmentValid = false" + v-on:input="variant.attachmentValid = true" class="variant-attachment-content" > @@ -718,6 +720,10 @@ export default { }, handleErr.bind(this)) }, putVariant (variant) { + if (variant.attachmentValid === false) { + this.$message.error('variant attachment is not valid') + return + } Axios.put( `${API_URL}/flags/${this.flagId}/variants/${variant.id}`, variant