#157 - more interactive calendar #162

Merged
kamilniemczycki merged 20 commits from #157-expansion-calendar into main 2022-06-08 11:02:38 +02:00
5 changed files with 48 additions and 14 deletions
Showing only changes of commit 04d036a1ef - Show all commits

View File

@@ -28,6 +28,7 @@ use Toby\Domain\VacationTypeConfigRetriever;
use Toby\Eloquent\Helpers\YearPeriodRetriever; use Toby\Eloquent\Helpers\YearPeriodRetriever;
use Toby\Eloquent\Models\User; use Toby\Eloquent\Models\User;
use Toby\Eloquent\Models\VacationRequest; use Toby\Eloquent\Models\VacationRequest;
use Toby\Infrastructure\Http\Requests\CreateVacationRequestRequest;
use Toby\Infrastructure\Http\Requests\VacationRequestRequest; use Toby\Infrastructure\Http\Requests\VacationRequestRequest;
use Toby\Infrastructure\Http\Resources\SimpleUserResource; use Toby\Infrastructure\Http\Resources\SimpleUserResource;
use Toby\Infrastructure\Http\Resources\VacationRequestActivityResource; use Toby\Infrastructure\Http\Resources\VacationRequestActivityResource;
@@ -166,17 +167,14 @@ class VacationRequestController extends Controller
return $pdf->stream(); return $pdf->stream();
} }
public function create(Request $request): Response public function create(CreateVacationRequestRequest $request): Response
{ {
$users = User::query() $users = User::query()
->orderByProfileField("last_name") ->orderByProfileField("last_name")
->orderByProfileField("first_name") ->orderByProfileField("first_name")
->get(); ->get();
if(($selectedUserId = $request->get("user")) && is_numeric($selectedUserId)) { $requestData = $request->data();
$userId = User::query()
->find($selectedUserId)?->id;
}
return inertia("VacationRequest/Create", [ return inertia("VacationRequest/Create", [
"vacationTypes" => VacationType::casesToSelect(), "vacationTypes" => VacationType::casesToSelect(),
@@ -185,8 +183,8 @@ class VacationRequestController extends Controller
"createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee", VacationRequest::class), "createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee", VacationRequest::class),
"skipFlow" => $request->user()->can("skipFlow", VacationRequest::class), "skipFlow" => $request->user()->can("skipFlow", VacationRequest::class),
], ],
"userId" => $userId ?? null, "vacationUserId" => $requestData['user'],
"vacationStartDate" => $request->get("start_date"), "vacationFromDate" => $requestData['from_date'],
]); ]);
} }

View File

@@ -0,0 +1,36 @@
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
<?php
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
declare(strict_types=1);
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
namespace Toby\Infrastructure\Http\Requests;
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
use Illuminate\Foundation\Http\FormRequest;
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
use Toby\Eloquent\Models\VacationRequest;
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
class CreateVacationRequestRequest extends FormRequest
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
protected $redirectRoute = "vacation.requests.create";
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
public function authorize(): bool
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
return is_null($this->get("user")) ||
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
(int)$this->get("user") === $this->user()->id ||
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
$this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
public function rules(): array
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
return [
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
"user" => ["nullable", "exists:users,id"],
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
"from_date" => ["nullable", "date_format:Y-m-d"],
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
];
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
public function data(): array
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
{
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
return [
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
"user" => (int)$this->get('user'),
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
"from_date" => $this->get('from_date'),
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
];
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.
}
krzysztofrewak commented 2022-06-06 12:25:26 +02:00 (Migrated from github.com)
Review
        return ($this->get("user") === null) ||
            ((int)$this->get("user") === $this->user()->id) ||
            $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class);
```suggestion return ($this->get("user") === null) || ((int)$this->get("user") === $this->user()->id) || $this->user()->can("createOnBehalfOfEmployee", VacationRequest::class); ```
Baakoma commented 2022-06-07 08:45:48 +02:00 (Migrated from github.com)
Review

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.

Honestly, I would prefer to not use form request for things like that (optional GET params, authorization, etc), at least not in a project where it is not standard and we did all authorization inside controller methods.
kamilniemczycki commented 2022-06-07 10:52:15 +02:00 (Migrated from github.com)
Review
Restore this version? https://github.com/blumilksoftware/toby/commit/5f02e23f511a4381199f6b9d9e38f6cc4da638c1#diff-0a0b7b715da129fe7e856b493c478b10a56016e20690ffdc592c20239b4a8e7d
Baakoma commented 2022-06-07 10:59:20 +02:00 (Migrated from github.com)
Review

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

Yeah, but I'm not sure if you need to find user by id in this case. Just pass user Id from request to Inertia as you did with start date.

View File

@@ -89,7 +89,7 @@
<InertiaLink <InertiaLink
v-if="day.isFuture" v-if="day.isFuture"
href="/vacation/requests/create" href="/vacation/requests/create"
:data="{ 'start_date': day.date.toISODate() }" :data="{ 'from_date': day.date.toISODate() }"
class="py-1.5 w-full font-medium bg-white hover:bg-blumilk-25 border-b-4 border-transparent focus:outline-blumilk-500" class="py-1.5 w-full font-medium bg-white hover:bg-blumilk-25 border-b-4 border-transparent focus:outline-blumilk-500"
> >
<time <time

View File

@@ -173,6 +173,6 @@ function unsetActiveDay() {
} }
function linkParameters(user, day) { function linkParameters(user, day) {
return props.can.createOnBehalfOfEmployee ? { user: user.id, start_date: day.date } : { start_date: day.date } return props.can.createOnBehalfOfEmployee ? { user: user.id, from_date: day.date } : { from_date: day.date }
} }
</script> </script>

View File

@@ -343,16 +343,16 @@ const props = defineProps({
users: Object, users: Object,
holidays: Object, holidays: Object,
can: Object, can: Object,
userId: [Number, null], vacationUserId: [Number, null],
vacationStartDate: [String, null], vacationFromDate: [String, null],
}) })
const form = useForm({ const form = useForm({
user: props.can.createOnBehalfOfEmployee user: props.can.createOnBehalfOfEmployee
? props.users.data.find(user => user.id === (props.userId ?? props.auth.user.id)) ?? props.users.data[0] ? props.users.data.find(user => user.id === (props.vacationUserId ?? props.auth.user.id)) ?? props.users.data[0]
: props.auth.user, : props.auth.user,
from: props.vacationStartDate, from: props.vacationFromDate,
to: props.vacationStartDate, to: props.vacationFromDate,
vacationType: null, vacationType: null,
comment: null, comment: null,
flowSkipped: false, flowSkipped: false,