@@ -2,7 +2,6 @@ import Controller from "@ember/controller";
22import { action } from "@ember/object" ;
33import { inject as service } from "@ember/service" ;
44import { tracked } from "@glimmer/tracking" ;
5- import completeWorkItem from "caluma-portal-demo/gql/mutations/complete-work-item" ;
65import saveWorkItem from "caluma-portal-demo/gql/mutations/save-work-item" ;
76import { queryManager } from "ember-apollo-client" ;
87import { dropTask } from "ember-concurrency-decorators" ;
@@ -21,32 +20,10 @@ export default class CasesDetailWorkItemsEditController extends Controller {
2120
2221 @tracked description = this . workItem . description ;
2322
24- @dropTask
25- * finishWorkItem ( event ) {
26- event . preventDefault ( ) ;
27-
28- try {
29- yield this . apollo . mutate ( {
30- mutation : saveWorkItem ,
31- variables : {
32- input : {
33- workItem : this . workItem . id ,
34- meta : JSON . stringify ( this . workItem . meta ) ,
35- } ,
36- } ,
37- } ) ;
38-
39- yield this . apollo . mutate ( {
40- mutation : completeWorkItem ,
41- variables : { id : this . workItem . id } ,
42- } ) ;
23+ finishWorkItem ( ) {
24+ this . notification . success ( this . intl . t ( "workItems.finishSuccess" ) ) ;
4325
44- this . notification . success ( this . intl . t ( "workItems.finishSuccess" ) ) ;
45-
46- this . router . transitionTo ( "cases.detail.work-items.index" ) ;
47- } catch ( error ) {
48- this . notification . danger ( this . intl . t ( "workItems.saveError" ) ) ;
49- }
26+ this . router . transitionTo ( "cases.detail.work-items.index" ) ;
5027 }
5128
5229 @dropTask
0 commit comments