create notification bruno request and move some routes

This commit is contained in:
2025-12-17 14:32:01 +01:00
parent 090db4205a
commit 7390ae6116
21 changed files with 113 additions and 37 deletions
+1
View File
@@ -23,5 +23,6 @@ class AppServiceProvider extends ServiceProvider
Route::middleware('api')->prefix('api')->group(base_path('routes/users.php')); Route::middleware('api')->prefix('api')->group(base_path('routes/users.php'));
Route::middleware('api')->prefix('api')->group(base_path('routes/auth.php')); Route::middleware('api')->prefix('api')->group(base_path('routes/auth.php'));
Route::middleware('api')->prefix('api')->group(base_path('routes/events.php')); Route::middleware('api')->prefix('api')->group(base_path('routes/events.php'));
Route::middleware('api')->prefix('api')->group(base_path('routes/notifications.php'));
} }
} }
+1 -1
View File
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="logoIcone.png" /> <link rel="icon" type="image/svg+xml" href="logoIcone.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Comité des fêtes de Beaupont</title> <title>Comité des fêtes de Beaupont</title>
<script type="module" crossorigin src="/assets/index-Bm5We1uf.js"></script> <script type="module" crossorigin src="/assets/index-1oYDhgBl.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DBz-GVvs.css"> <link rel="stylesheet" crossorigin href="/assets/index-DBz-GVvs.css">
</head> </head>
<body> <body>
+14
View File
@@ -0,0 +1,14 @@
<?php
use App\Http\Controllers\NotificationsController;
use Illuminate\Support\Facades\Route;
Route::middleware(['web', 'auth:sanctum'])->get('/users/{id}/notifications', [NotificationsController::class, "getNotifications"])
->whereNumber('id');
Route::middleware(['web', 'auth:sanctum'])->post("/users/{id}/create/notification", [NotificationsController::class, "createNotification"])
->whereNumber('id');
Route::middleware(['web', 'auth:sanctum'])->delete('/users/{userId}/delete/notification/{notificationId}', [NotificationsController::class, 'deleteNotification'])
->whereNumber('userId')
->whereNumber('notificationId');
-15
View File
@@ -1,13 +1,8 @@
<?php <?php
use App\Http\Controllers\AuthController;
use App\Http\Controllers\SearchController; use App\Http\Controllers\SearchController;
use App\Http\Controllers\UserController; use App\Http\Controllers\UserController;
use App\Http\Controllers\EventsController;
use App\Http\Controllers\NotificationsController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use App\Http\Controllers\TasksController;
@@ -37,15 +32,5 @@ Route::middleware(['web', 'auth:sanctum'])->get('/users/{id}/tasks', [UserContro
Route::middleware(['web', 'auth:sanctum'])->get('/users/tasks/{idTask}', [UserController::class, "getUserTaskById"]); Route::middleware(['web', 'auth:sanctum'])->get('/users/tasks/{idTask}', [UserController::class, "getUserTaskById"]);
Route::middleware(['web', 'auth:sanctum'])->get('/users/{id}/notifications', [NotificationsController::class, "getNotifications"])
->whereNumber('id');
Route::middleware(['web', 'auth:sanctum'])->post("/users/{id}/create/notification", [NotificationsController::class, "createNotification"])
->whereNumber('id');
Route::middleware(['web', 'auth:sanctum'])->delete('/users/{userId}/delete/notification/{notificationId}', [NotificationsController::class, 'deleteNotification'])
->whereNumber('userId')
->whereNumber('notificationId');
Route::middleware(['web', 'auth:sanctum'])->get('/users/search', [SearchController::class, "searchUsers"]); Route::middleware(['web', 'auth:sanctum'])->get('/users/search', [SearchController::class, "searchUsers"]);
+3 -3
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Login name: Login
type: http type: http
seq: 6 seq: 5
} }
post { post {
@@ -18,8 +18,8 @@ body:json {
} }
vars:pre-request { vars:pre-request {
email: user@test.com email: gio@gmail.com
password: 1234 password: 12345678
} }
assert { assert {
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Logout name: Logout
type: http type: http
seq: 7 seq: 8
} }
post { post {
@@ -0,0 +1,27 @@
meta {
name: Create notification
type: http
seq: 12
}
post {
url: {{url}}/api/users/{{id}}/create/notification
body: json
auth: inherit
}
body:json {
{
"content": "{{content}}"
}
}
vars:pre-request {
id: 12
content: test
}
settings {
encodeUrl: true
timeout: 0
}
@@ -0,0 +1,21 @@
meta {
name: Delete user notification
type: http
seq: 3
}
delete {
url: {{url}}/api/users/{{userId}}/delete/notification/{{notificationId}}
body: none
auth: inherit
}
vars:pre-request {
userId:
notificationId:
}
settings {
encodeUrl: true
timeout: 0
}
@@ -0,0 +1,20 @@
meta {
name: Get user notifications
type: http
seq: 12
}
get {
url: {{url}}/api/users/{{id}}/notifications
body: none
auth: inherit
}
vars:pre-request {
id: 12
}
settings {
encodeUrl: true
timeout: 0
}
+8
View File
@@ -0,0 +1,8 @@
meta {
name: Notifications
seq: 8
}
auth {
mode: inherit
}
+6 -6
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Create user name: Create user
type: http type: http
seq: 6 seq: 5
} }
post { post {
@@ -21,11 +21,11 @@ body:json {
} }
vars:pre-request { vars:pre-request {
name: name: test
email: email: test@gmail.com
password: password: 12345678
lastname: lastname: test
phone: phone: 0607070707
} }
assert { assert {
+1 -1
View File
@@ -11,7 +11,7 @@ delete {
} }
vars:pre-request { vars:pre-request {
id: id: 15
} }
settings { settings {
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Delete user name: Delete user
type: http type: http
seq: 8 seq: 6
} }
delete { delete {
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Get User name: Get User
type: http type: http
seq: 3 seq: 1
} }
get { get {
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Modify user role name: Modify user role
type: http type: http
seq: 6 seq: 3
} }
post { post {
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Search users name: Search users
type: http type: http
seq: 12 seq: 11
} }
get { get {
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Update User name: Update User
type: http type: http
seq: 4 seq: 2
} }
post { post {
+2 -2
View File
@@ -1,7 +1,7 @@
meta { meta {
name: Validate User name: Validate User
type: http type: http
seq: 5 seq: 4
} }
post { post {
@@ -11,7 +11,7 @@ post {
} }
vars:pre-request { vars:pre-request {
id: id: 13
} }
settings { settings {
+1 -1
View File
@@ -1,6 +1,6 @@
meta { meta {
name: Users name: Users
seq: 8 seq: 9
} }
auth { auth {
+1 -1
View File
@@ -1,4 +1,4 @@
headers { headers {
Accept: application/json Accept: application/json
X-XSRF-TOKEN: eyJpdiI6Ii9YZURUS2taQlBjVXB3azhoelpqS3c9PSIsInZhbHVlIjoiYzdpSmVhVWlZRnlvVWR1RWlHbEtwcUp5R1dQNUJXckFTRm9Tb0xYcGszdmZNb0p4NTFDM2tBMEZjTkdqYWlnSmRWZi9LdFgyczJZam1DdUVUcW84TXBOaDRmU1g5c2pseDVKMW50eTJGd3cxd3p5RjV2b2pGOGNwYzlmWDFkREkiLCJtYWMiOiI5NDY1YWM3YmE0ZDgyNWMxZDQwNTRiZWIxNWU3OTA0NjYxNDkxMjRmZmVkOTA1Y2U3YTE2ZGY2YWViYWE2ZmRjIiwidGFnIjoiIn0= X-XSRF-TOKEN: eyJpdiI6ImhRZnBQM1N5RFQ4L0duVm5wMEdHcUE9PSIsInZhbHVlIjoiSXFYdGt6Uk1vRUNmYnpnRXNXMVpzeW5sWTlBaW1yRmsvWG9pR01JQnYyTzNvclpoaVZZUkgwL2VYWlBjaEYzcDVnUXprUnBFa3dVL09nTVphQUhsTEtENjhjbUFoRzB0RkMzenRleit1SXVWQWFqNTgwSWFMZ0RuNHNtenpDQ1ciLCJtYWMiOiJmMDM4YjVhMDAzNjE0Y2VlZTY0NDA2YTY5ZWRmYjExZTRkYzlhNmIzMWNmNjcyMmIxYTg0YjFhNWUxZDZlMDM1IiwidGFnIjoiIn0=
} }
+1 -1
View File
@@ -1,7 +1,7 @@
meta { meta {
name: me name: me
type: http type: http
seq: 5 seq: 6
} }
get { get {