add start and end date and test for null entries
This commit is contained in:
parent
f8a1c2616d
commit
a752ff9ba5
3 changed files with 56 additions and 0 deletions
|
|
@ -42,6 +42,14 @@ class CreatePlan
|
|||
throw new BadRequestException('name is required');
|
||||
}
|
||||
|
||||
if ($request->dateStart === null) {
|
||||
throw new BadRequestException('date start is required');
|
||||
}
|
||||
|
||||
if ($request->dateEnd === null) {
|
||||
throw new BadRequestException('date end is required');
|
||||
}
|
||||
|
||||
$userId = $request->userId;
|
||||
$user = $this->userRepo->find($userId);
|
||||
if ($user === null) {
|
||||
|
|
|
|||
|
|
@ -8,5 +8,7 @@ class CreatePlanRequest
|
|||
public ?int $userId,
|
||||
public ?int $textId,
|
||||
public ?string $name,
|
||||
public ?string $dateStart,
|
||||
public ?string $dateEnd,
|
||||
) {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue