File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
components/organisms/labels Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 12
12
ref =" form"
13
13
v-model =" valid"
14
14
>
15
+ <v-alert
16
+ v-show =" showError"
17
+ v-model =" showError"
18
+ type =" error"
19
+ dismissible
20
+ >
21
+ The label could not be created.
22
+ You cannot use same label name or shortcut key.
23
+ </v-alert >
15
24
<v-text-field
16
25
v-model =" labelName"
17
26
:rules =" labelNameRules"
@@ -64,7 +73,8 @@ export default {
64
73
suffixKey: ' ' ,
65
74
color: ' ' ,
66
75
labelNameRules,
67
- colorRules
76
+ colorRules,
77
+ showError: false
68
78
}
69
79
},
70
80
@@ -88,8 +98,13 @@ export default {
88
98
background_color: this .color .slice (0 , - 2 ),
89
99
text_color: ' #ffffff'
90
100
})
91
- this .reset ()
92
- this .cancel ()
101
+ .then (() => {
102
+ this .reset ()
103
+ this .cancel ()
104
+ })
105
+ .catch (() => {
106
+ this .showError = true
107
+ })
93
108
}
94
109
}
95
110
}
Original file line number Diff line number Diff line change @@ -52,13 +52,10 @@ export const actions = {
52
52
} )
53
53
} ,
54
54
createLabel ( { commit } , data ) {
55
- LabelService . addLabel ( data . projectId , data )
55
+ return LabelService . addLabel ( data . projectId , data )
56
56
. then ( ( response ) => {
57
57
commit ( 'addLabel' , response . data )
58
58
} )
59
- . catch ( ( error ) => {
60
- alert ( error )
61
- } )
62
59
} ,
63
60
updateLabel ( { commit } , data ) {
64
61
LabelService . updateLabel ( data . projectId , data . id , data )
You can’t perform that action at this time.
0 commit comments