@@ -128,6 +128,7 @@ import Description from '../components/card/Description.vue'
128128import CardPlusOutline from ' vue-material-design-icons/CardPlusOutline.vue'
129129import FormatColumnsIcon from ' vue-material-design-icons/FormatColumns.vue'
130130import DeckIcon from ' ../components/icons/DeckIcon.vue'
131+ import { showError } from ' ../helpers/errors.js'
131132
132133const cardApi = new CardApi ()
133134const apiClient = new BoardApi ()
@@ -216,7 +217,7 @@ export default {
216217 fetchBoards () {
217218 axios .get (generateUrl (' /apps/deck/boards' )).then ((response ) => {
218219 this .boards = response .data .filter ((board ) => {
219- return board? .permissions ? .PERMISSION_EDIT
220+ return board? .permissions ? .PERMISSION_EDIT && ! board ? . archived && ! board ? . deletedAt
220221 })
221222 this .loading = false
222223 })
@@ -239,19 +240,30 @@ export default {
239240 },
240241 async createCard () {
241242 this .creating = true
242- const response = await cardApi .addCard ({
243- boardId: this .selectedBoard .id ,
244- stackId: this .selectedStack .id ,
245- title: this .card .title ,
246- description: this .card .description ,
247- duedate: this .card .duedate ,
248- labels: this .card .labels .map (label => label .id ),
249- users: this .card .assignedUsers .map (user => { return { id: user .uid , type: user .type } }),
250- })
251- this .newCard = response
252- this .creating = false
253- this .created = true
254- this .$emit (' submit' , window .location .protocol + ' //' + window .location .host + generateUrl (' /apps/deck' ) + ` /card/${ this .newCard .id } ` )
243+
244+ try {
245+ const response = await cardApi .addCard ({
246+ boardId: this .selectedBoard .id ,
247+ stackId: this .selectedStack .id ,
248+ title: this .card .title ,
249+ description: this .card .description ,
250+ duedate: this .card .duedate ,
251+ labels: this .card .labels .map (label => label .id ),
252+ users: this .card .assignedUsers .map (user => {
253+ return {
254+ id: user .uid ,
255+ type: user .type ,
256+ }
257+ }),
258+ })
259+ this .newCard = response
260+ this .creating = false
261+ this .created = true
262+ this .$emit (' submit' , window .location .protocol + ' //' + window .location .host + generateUrl (' /apps/deck' ) + ` /card/${ this .newCard .id } ` )
263+ } catch (e) {
264+ this .creating = false
265+ showError (e)
266+ }
255267 },
256268 onSelectLabel (label ) {
257269 this .card .labels .push (label)
0 commit comments