| @@ 160-177 (lines=18) @@ | ||
| 157 | * |
|
| 158 | * @return \Illuminate\Http\RedirectResponse |
|
| 159 | */ |
|
| 160 | public function updateAction($path) |
|
| 161 | { |
|
| 162 | $groupData = Binput::get('group'); |
|
| 163 | $group = Owner::where('path', '=', $path)->first(); |
|
| 164 | try { |
|
| 165 | $groupData['owner'] = $group; |
|
| 166 | $groupData['user_id'] = Auth::user()->id; |
|
| 167 | $group = $this->dispatchFromArray(UpdateOwnerCommand::class, $groupData); |
|
| 168 | } catch (ValidationException $e) { |
|
| 169 | return Redirect::route('groups.group_edit', ['owner' => $group->path]) |
|
| 170 | ->withInput(Binput::all()) |
|
| 171 | ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('gitamin.groups.edit.failure'))) |
|
| 172 | ->withErrors($e->getMessageBag()); |
|
| 173 | } |
|
| 174 | ||
| 175 | return Redirect::route('groups.group_edit', ['owner' => $group->path]) |
|
| 176 | ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('gitamin.groups.edit.success'))); |
|
| 177 | } |
|
| 178 | } |
|
| 179 | ||
| @@ 69-87 (lines=19) @@ | ||
| 66 | * |
|
| 67 | * @return \Illuminate\Http\Response |
|
| 68 | */ |
|
| 69 | public function create($namespace, $project_path) |
|
| 70 | { |
|
| 71 | $project = Project::findByPath($namespace, $project_path); |
|
| 72 | $issueData = Binput::get('issue'); |
|
| 73 | ||
| 74 | try { |
|
| 75 | $issueData['author_id'] = Auth::user()->id; |
|
| 76 | $issueData['project_id'] = $project->id; |
|
| 77 | $issue = $this->dispatchFromArray(AddIssueCommand::class, $issueData); |
|
| 78 | } catch (ValidationException $e) { |
|
| 79 | return Redirect::route('projects.issue_new') |
|
| 80 | ->withInput(Binput::all()) |
|
| 81 | ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.issues.new.failure'))) |
|
| 82 | ->withErrors($e->getMessageBag()); |
|
| 83 | } |
|
| 84 | ||
| 85 | return Redirect::route('projects.issue_index', ['namespace' => $namespace, 'project' => $project_path]) |
|
| 86 | ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.issues.new.success'))); |
|
| 87 | } |
|
| 88 | } |
|
| 89 | ||