| @@ 145-158 (lines=14) @@ | ||
| 142 | 'workflow_id' => 'required', |
|
| 143 | ]); |
|
| 144 | ||
| 145 | if($validator->fails()){ |
|
| 146 | //if($check > 0){ |
|
| 147 | $response['message'] = 'failed transition allready exist !'; |
|
| 148 | $response['status'] = false; |
|
| 149 | // }else{ |
|
| 150 | // $response['message'] = 'success add new transition'; |
|
| 151 | // $response['status'] = true; |
|
| 152 | // $this->transitionModel->create($request); |
|
| 153 | // } |
|
| 154 | }else{ |
|
| 155 | $response['message'] = 'success add new transition'; |
|
| 156 | $response['status'] = true; |
|
| 157 | $this->transitionModel->create($request); |
|
| 158 | } |
|
| 159 | ||
| 160 | return response()->json($response); |
|
| 161 | } |
|
| @@ 109-115 (lines=7) @@ | ||
| 106 | 'name' => 'required' |
|
| 107 | ]); |
|
| 108 | ||
| 109 | if($validator->fails()){ |
|
| 110 | $response['message'] = 'failed transition allready exist !'; |
|
| 111 | $response['status'] = false; |
|
| 112 | }else{ |
|
| 113 | $response['message'] = 'success add new transition'; |
|
| 114 | $response['status'] = true; |
|
| 115 | } |
|
| 116 | ||
| 117 | //$this->insertWithWorkflow($this->workflowModel, $request); |
|
| 118 | $this->workflowModel->create($request); |
|