Skip to content

Commit

Permalink
PG-30
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Dec 1, 2023
1 parent f2a63ab commit 06841bc
Show file tree
Hide file tree
Showing 31 changed files with 139 additions and 120 deletions.
13 changes: 5 additions & 8 deletions src/Http/Controllers/BacklogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|BacklogCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new BacklogCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new BacklogCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new BacklogResource($backlog))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new BacklogResource($backlog))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new BacklogResource($backlog))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/BoardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|BoardCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new BoardCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new BoardCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new BoardResource($board))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new BoardResource($board))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new BoardResource($board))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/EpicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|EpicCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new EpicCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new EpicCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new EpicResource($epic))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new EpicResource($epic))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new EpicResource($epic))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/FlowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|FlowCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new FlowCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new FlowCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new FlowResource($flow))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new FlowResource($flow))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new FlowResource($flow))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/MilestoneController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|MilestoneCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new MilestoneCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new MilestoneCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new MilestoneResource($milestone))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new MilestoneResource($milestone))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new MilestoneResource($milestone))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/NoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|NoteCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new NoteCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new NoteCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new NoteResource($note))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new NoteResource($note))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new NoteResource($note))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|ProjectCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new ProjectCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new ProjectCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new ProjectResource($project))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new ProjectResource($project))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new ProjectResource($project))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/ReleaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function lock(
*/
public function index(
IndexRequest $request
): JsonResponse|View {
): JsonResponse|View|ReleaseCollection {
$user = $request->user();

$validated = $request->validated();
Expand Down Expand Up @@ -261,10 +261,7 @@ public function index(
$paginator->appends($validated);

if ($request->expectsJson()) {
return (new ReleaseCollection($paginator))->additional(['meta' => [
'session_user_id' => $user?->id,
'validated' => $validated,
]]);
return (new ReleaseCollection($paginator))->response($request);
}

$meta = [
Expand Down Expand Up @@ -378,7 +375,7 @@ public function store(
return (new ReleaseResource($release))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -408,7 +405,7 @@ public function unlock(
return (new ReleaseResource($release))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down Expand Up @@ -436,7 +433,7 @@ public function update(
return (new ReleaseResource($release))->response($request);
}

$returnUrl = $validated['return_url'] ?? '';
$returnUrl = $validated['_return_url'] ?? '';

if ($returnUrl) {
return redirect($returnUrl);
Expand Down
Loading

0 comments on commit 06841bc

Please sign in to comment.