Added tag endpoints

This commit is contained in:
Constantin Graf
2024-02-27 22:12:48 +01:00
parent 524dc0727d
commit a86e72f655
19 changed files with 824 additions and 138 deletions

View File

@@ -114,11 +114,13 @@ class TimeEntryController extends Controller
if ($request->get('end') === null && TimeEntry::query()->where('user_id', $request->get('user_id'))->where('end', null)->exists()) {
// TODO: API documentation
// TODO: Create concept for api exceptions
throw new TimeEntryStillRunning('User already has an active time entry');
}
$timeEntry = new TimeEntry();
$timeEntry->fill($request->validated());
$timeEntry->description = $request->get('description', '');
$timeEntry->organization()->associate($organization);
$timeEntry->save();