mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 02:02:15 +01:00
add dashboard frontend
This commit is contained in:
@@ -28,6 +28,8 @@ class ProjectController extends Controller
|
||||
* Get projects
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId getProjects
|
||||
*/
|
||||
public function index(Organization $organization): JsonResource
|
||||
{
|
||||
@@ -43,6 +45,8 @@ class ProjectController extends Controller
|
||||
* Get project
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId getProject
|
||||
*/
|
||||
public function show(Organization $organization, Project $project): JsonResource
|
||||
{
|
||||
@@ -57,6 +61,8 @@ class ProjectController extends Controller
|
||||
* Create project
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId createProject
|
||||
*/
|
||||
public function store(Organization $organization, ProjectStoreRequest $request): JsonResource
|
||||
{
|
||||
@@ -75,6 +81,8 @@ class ProjectController extends Controller
|
||||
* Update project
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId updateProject
|
||||
*/
|
||||
public function update(Organization $organization, Project $project, ProjectUpdateRequest $request): JsonResource
|
||||
{
|
||||
@@ -90,6 +98,8 @@ class ProjectController extends Controller
|
||||
* Delete project
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId deleteProject
|
||||
*/
|
||||
public function destroy(Organization $organization, Project $project): JsonResponse
|
||||
{
|
||||
|
||||
@@ -27,6 +27,8 @@ class TagController extends Controller
|
||||
* Get tags
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId getTags
|
||||
*/
|
||||
public function index(Organization $organization): TagCollection
|
||||
{
|
||||
@@ -44,6 +46,8 @@ class TagController extends Controller
|
||||
* Create tag
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId createTag
|
||||
*/
|
||||
public function store(Organization $organization, TagStoreRequest $request): TagResource
|
||||
{
|
||||
@@ -61,6 +65,8 @@ class TagController extends Controller
|
||||
* Update tag
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId updateTag
|
||||
*/
|
||||
public function update(Organization $organization, Tag $tag, TagUpdateRequest $request): TagResource
|
||||
{
|
||||
@@ -76,6 +82,8 @@ class TagController extends Controller
|
||||
* Delete tag
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId deleteTag
|
||||
*/
|
||||
public function destroy(Organization $organization, Tag $tag): JsonResponse
|
||||
{
|
||||
|
||||
@@ -32,6 +32,8 @@ class TimeEntryController extends Controller
|
||||
* Get time entries
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId getTimeEntries
|
||||
*/
|
||||
public function index(Organization $organization, TimeEntryIndexRequest $request): JsonResource
|
||||
{
|
||||
@@ -103,6 +105,8 @@ class TimeEntryController extends Controller
|
||||
* Create time entry
|
||||
*
|
||||
* @throws AuthorizationException|TimeEntryStillRunning
|
||||
*
|
||||
* @operationId createTimeEntry
|
||||
*/
|
||||
public function store(Organization $organization, TimeEntryStoreRequest $request): JsonResource
|
||||
{
|
||||
@@ -120,7 +124,7 @@ class TimeEntryController extends Controller
|
||||
|
||||
$timeEntry = new TimeEntry();
|
||||
$timeEntry->fill($request->validated());
|
||||
$timeEntry->description = $request->get('description', '');
|
||||
$timeEntry->description = $request->get('description') ?? '';
|
||||
$timeEntry->organization()->associate($organization);
|
||||
$timeEntry->save();
|
||||
|
||||
@@ -131,6 +135,8 @@ class TimeEntryController extends Controller
|
||||
* Update time entry
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId updateTimeEntry
|
||||
*/
|
||||
public function update(Organization $organization, TimeEntry $timeEntry, TimeEntryUpdateRequest $request): JsonResource
|
||||
{
|
||||
@@ -141,6 +147,7 @@ class TimeEntryController extends Controller
|
||||
}
|
||||
|
||||
$timeEntry->fill($request->validated());
|
||||
$timeEntry->description = $request->get('description', $timeEntry->description) ?? '';
|
||||
$timeEntry->save();
|
||||
|
||||
return new TimeEntryResource($timeEntry);
|
||||
@@ -150,6 +157,8 @@ class TimeEntryController extends Controller
|
||||
* Delete time entry
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId deleteTimeEntry
|
||||
*/
|
||||
public function destroy(Organization $organization, TimeEntry $timeEntry): JsonResponse
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user