Skip to content

Commit

Permalink
Fix json attachment validation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzhuojie committed Mar 17, 2020
1 parent 6f8bf7b commit 5335ed6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions browser/flagr-ui/src/components/Flag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
></vue-json-editor>
</el-collapse-item>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5335ed6

Please sign in to comment.