| @@ 70-88 (lines=19) @@ | ||
| 67 | * |
|
| 68 | * @return \Illuminate\Http\Response |
|
| 69 | */ |
|
| 70 | public function createAction($namespace, $project_path) |
|
| 71 | { |
|
| 72 | $project = Project::findByPath($namespace, $project_path); |
|
| 73 | $issueData = Binput::get('issue'); |
|
| 74 | ||
| 75 | try { |
|
| 76 | $issueData['author_id'] = Auth::user()->id; |
|
| 77 | $issueData['project_id'] = $project->id; |
|
| 78 | $issue = $this->dispatchFromArray(AddIssueCommand::class, $issueData); |
|
| 79 | } catch (ValidationException $e) { |
|
| 80 | return Redirect::route('projects.issue_new') |
|
| 81 | ->withInput(Binput::all()) |
|
| 82 | ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.issues.new.failure'))) |
|
| 83 | ->withErrors($e->getMessageBag()); |
|
| 84 | } |
|
| 85 | ||
| 86 | return Redirect::route('projects.issue_index', ['owner' => $namespace, 'project' => $project_path]) |
|
| 87 | ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.issues.new.success'))); |
|
| 88 | } |
|
| 89 | ||
| 90 | public function editAction($owner_path, $project_path, Issue $issue) |
|
| 91 | { |
|
| @@ 117-134 (lines=18) @@ | ||
| 114 | * |
|
| 115 | * @return \Illuminate\Http\RedirectResponse |
|
| 116 | */ |
|
| 117 | public function updateAction($path) |
|
| 118 | { |
|
| 119 | $groupData = Binput::get('group'); |
|
| 120 | $group = Owner::where('path', '=', $path)->first(); |
|
| 121 | try { |
|
| 122 | $groupData['owner'] = $group; |
|
| 123 | $groupData['user_id'] = Auth::user()->id; |
|
| 124 | $group = $this->dispatchFromArray(UpdateOwnerCommand::class, $groupData); |
|
| 125 | } catch (ValidationException $e) { |
|
| 126 | return Redirect::route('groups.group_edit', ['owner' => $group->path]) |
|
| 127 | ->withInput(Binput::all()) |
|
| 128 | ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('gitamin.groups.edit.failure'))) |
|
| 129 | ->withErrors($e->getMessageBag()); |
|
| 130 | } |
|
| 131 | ||
| 132 | return Redirect::route('groups.group_edit', ['owner' => $group->path]) |
|
| 133 | ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('gitamin.groups.edit.success'))); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | ||