mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
Added time entry api endpoints; Increased phpstan level; renamed to solidtime
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Http\Controllers\Api\V1\ProjectController;
|
||||
use App\Http\Controllers\Api\V1\TimeEntryController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -25,4 +27,21 @@ Route::middleware('auth:api')->prefix('v1')->name('v1.')->group(static function
|
||||
Route::delete('/organization/{organization}/projects/{project}', [ProjectController::class, 'destroy'])->name('destroy');
|
||||
});
|
||||
|
||||
Route::name('time-entries.')->group(static function () {
|
||||
Route::get('/organization/{organization}/time-entries', [TimeEntryController::class, 'index'])->name('index');
|
||||
Route::post('/organization/{organization}/time-entries', [TimeEntryController::class, 'store'])->name('store');
|
||||
Route::put('/organization/{organization}/time-entries/{timeEntry}', [TimeEntryController::class, 'update'])->name('update');
|
||||
Route::delete('/organization/{organization}/time-entries/{timeEntry}', [TimeEntryController::class, 'destroy'])->name('destroy');
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Fallback routes, to prevent a rendered HTML page in /api/* routes
|
||||
* The / route is also included since the fallback is not triggered on the root route
|
||||
*/
|
||||
Route::get('/', function (): void {
|
||||
throw new NotFoundHttpException('API resource not found');
|
||||
});
|
||||
Route::fallback(function (): void {
|
||||
throw new NotFoundHttpException('API resource not found');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user