use uuid instead of id to delete notifications
This commit is contained in:
1 parent
cdc4645d92
commit
cbe816fd17
2 files changed
+2
-2
No files matched your search
@@ -23,7 +23,7 @@ class NotificationsController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteNotification(Request $request, int $notificationId): JsonResponse
|
public function deleteNotification(Request $request, string $notificationId): JsonResponse
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$notification = $request->user()->notifications()->findOrFail($notificationId);
|
$notification = $request->user()->notifications()->findOrFail($notificationId);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
Route::middleware(['web', 'auth:sanctum'])->get('/users/notifications', [NotificationsController::class, "getNotifications"]);
|
Route::middleware(['web', 'auth:sanctum'])->get('/users/notifications', [NotificationsController::class, "getNotifications"]);
|
||||||
|
|
||||||
Route::middleware(['web', 'auth:sanctum'])->delete('/users/delete/notification/{notificationId}', [NotificationsController::class, 'deleteNotification'])
|
Route::middleware(['web', 'auth:sanctum'])->delete('/users/delete/notification/{notificationId}', [NotificationsController::class, 'deleteNotification'])
|
||||||
->whereNumber('notificationId');
|
->whereUuid('notificationId');
|
||||||
|
|
||||||
Route::middleware(['web', 'auth:sanctum'])->post('/users/notifications/read', [NotificationsController::class, "readNotifications"]);
|
Route::middleware(['web', 'auth:sanctum'])->post('/users/notifications/read', [NotificationsController::class, "readNotifications"]);
|
||||||
|
|
||||||
Reference in new issue
Block a user