resolve conflits
This commit is contained in:
@@ -1,61 +1,23 @@
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
[Frontend repository](https://iutbg-gitlab.iutbourg.univ-lyon1.fr/sae-but2/2025-26/gestion-benevoles-association/Frontend)
|
||||
|
||||
## About Laravel
|
||||
# Gestion des bénévoles d'une association
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
## Installation
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
- [Installer Laravel](https://laravel.com/docs/12.x#installing-php)
|
||||
- Configurer le projet
|
||||
- Renommer le fichier `.env.example` en `.env`
|
||||
- Remplir le `APP_KEY` dans `.env`
|
||||
- Remplir les paramètres de connexion à la base de données
|
||||
|
||||
Exemple configuration base de donnée (.env)
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
DB_CONNECTION=mariadb
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=sae
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=root
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Redberry](https://redberry.international/laravel-development)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Notification;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class NotificationsController extends Controller
|
||||
{
|
||||
public function create(Request $request, int $id): JsonResponse {
|
||||
$notification = Notification::create([
|
||||
"content" => $request["content"]
|
||||
]);
|
||||
|
||||
$notification->users()->attach($id);
|
||||
|
||||
return response()->json(['message' => 'Notification created successfully']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getNotifications(Request $request, int $id): JsonResponse {
|
||||
|
||||
try {
|
||||
$user = User::findOrFail($id);
|
||||
|
||||
return response()->json([
|
||||
'data' => $user->notifications
|
||||
]);
|
||||
} catch(\Exception $e) {
|
||||
Log::info($e->getMessage());
|
||||
return response()->json(['message' => "Server error"], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Notification extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'content',
|
||||
];
|
||||
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'user_notification', 'notification_id', 'user_id');
|
||||
}
|
||||
}
|
||||
@@ -54,4 +54,9 @@ class User extends Authenticatable
|
||||
public function tasks() {
|
||||
return $this->belongsToMany(Task::class);
|
||||
}
|
||||
|
||||
public function notifications(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Notification::class, 'user_notification', 'user_id', 'notification_id');
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+35
-35
@@ -1055,16 +1055,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v12.33.0",
|
||||
"version": "v12.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "124efc5f09d4668a4dc13f94a1018c524a58bcb1"
|
||||
"reference": "f9ec5a5d88bc8c468f17b59f88e05c8ac3c8d687"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/124efc5f09d4668a4dc13f94a1018c524a58bcb1",
|
||||
"reference": "124efc5f09d4668a4dc13f94a1018c524a58bcb1",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/f9ec5a5d88bc8c468f17b59f88e05c8ac3c8d687",
|
||||
"reference": "f9ec5a5d88bc8c468f17b59f88e05c8ac3c8d687",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1176,7 +1176,7 @@
|
||||
"league/flysystem-sftp-v3": "^3.25.1",
|
||||
"mockery/mockery": "^1.6.10",
|
||||
"opis/json-schema": "^2.4.1",
|
||||
"orchestra/testbench-core": "^10.6.5",
|
||||
"orchestra/testbench-core": "^10.7.0",
|
||||
"pda/pheanstalk": "^5.0.6|^7.0.0",
|
||||
"php-http/discovery": "^1.15",
|
||||
"phpstan/phpstan": "^2.0",
|
||||
@@ -1270,7 +1270,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2025-10-07T14:30:39+00:00"
|
||||
"time": "2025-10-14T13:58:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/prompts",
|
||||
@@ -1397,16 +1397,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v2.0.5",
|
||||
"version": "v2.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/serializable-closure.git",
|
||||
"reference": "3832547db6e0e2f8bb03d4093857b378c66eceed"
|
||||
"reference": "038ce42edee619599a1debb7e81d7b3759492819"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3832547db6e0e2f8bb03d4093857b378c66eceed",
|
||||
"reference": "3832547db6e0e2f8bb03d4093857b378c66eceed",
|
||||
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/038ce42edee619599a1debb7e81d7b3759492819",
|
||||
"reference": "038ce42edee619599a1debb7e81d7b3759492819",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1454,7 +1454,7 @@
|
||||
"issues": "https://github.com/laravel/serializable-closure/issues",
|
||||
"source": "https://github.com/laravel/serializable-closure"
|
||||
},
|
||||
"time": "2025-09-22T17:29:40+00:00"
|
||||
"time": "2025-10-09T13:42:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
@@ -2492,31 +2492,31 @@
|
||||
},
|
||||
{
|
||||
"name": "nunomaduro/termwind",
|
||||
"version": "v2.3.1",
|
||||
"version": "v2.3.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nunomaduro/termwind.git",
|
||||
"reference": "dfa08f390e509967a15c22493dc0bac5733d9123"
|
||||
"reference": "eb61920a53057a7debd718a5b89c2178032b52c0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nunomaduro/termwind/zipball/dfa08f390e509967a15c22493dc0bac5733d9123",
|
||||
"reference": "dfa08f390e509967a15c22493dc0bac5733d9123",
|
||||
"url": "https://api.github.com/repos/nunomaduro/termwind/zipball/eb61920a53057a7debd718a5b89c2178032b52c0",
|
||||
"reference": "eb61920a53057a7debd718a5b89c2178032b52c0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-mbstring": "*",
|
||||
"php": "^8.2",
|
||||
"symfony/console": "^7.2.6"
|
||||
"symfony/console": "^7.3.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"illuminate/console": "^11.44.7",
|
||||
"laravel/pint": "^1.22.0",
|
||||
"illuminate/console": "^11.46.1",
|
||||
"laravel/pint": "^1.25.1",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"pestphp/pest": "^2.36.0 || ^3.8.2",
|
||||
"phpstan/phpstan": "^1.12.25",
|
||||
"pestphp/pest": "^2.36.0 || ^3.8.4",
|
||||
"phpstan/phpstan": "^1.12.32",
|
||||
"phpstan/phpstan-strict-rules": "^1.6.2",
|
||||
"symfony/var-dumper": "^7.2.6",
|
||||
"symfony/var-dumper": "^7.3.4",
|
||||
"thecodingmachine/phpstan-strict-rules": "^1.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -2559,7 +2559,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nunomaduro/termwind/issues",
|
||||
"source": "https://github.com/nunomaduro/termwind/tree/v2.3.1"
|
||||
"source": "https://github.com/nunomaduro/termwind/tree/v2.3.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2575,7 +2575,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-05-08T08:14:37+00:00"
|
||||
"time": "2025-10-18T11:10:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoption/phpoption",
|
||||
@@ -6032,28 +6032,28 @@
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "1.11.0",
|
||||
"version": "1.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozarts/assert.git",
|
||||
"reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991"
|
||||
"reference": "541057574806f942c94662b817a50f63f7345360"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991",
|
||||
"reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991",
|
||||
"url": "https://api.github.com/repos/webmozarts/assert/zipball/541057574806f942c94662b817a50f63f7345360",
|
||||
"reference": "541057574806f942c94662b817a50f63f7345360",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-ctype": "*",
|
||||
"ext-date": "*",
|
||||
"ext-filter": "*",
|
||||
"php": "^7.2 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"phpstan/phpstan": "<0.12.20",
|
||||
"vimeo/psalm": "<4.6.1 || 4.6.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5.13"
|
||||
"suggest": {
|
||||
"ext-intl": "",
|
||||
"ext-simplexml": "",
|
||||
"ext-spl": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -6084,9 +6084,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/webmozarts/assert/issues",
|
||||
"source": "https://github.com/webmozarts/assert/tree/1.11.0"
|
||||
"source": "https://github.com/webmozarts/assert/tree/1.12.0"
|
||||
},
|
||||
"time": "2022-06-03T18:03:27+00:00"
|
||||
"time": "2025-10-20T12:43:39+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->string('content');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
};
|
||||
Generated
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "sae-back",
|
||||
"name": "backend",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
+7
-1
@@ -3,9 +3,10 @@
|
||||
use App\Http\Controllers\AuthController;
|
||||
use App\Http\Controllers\UserController;
|
||||
use App\Http\Controllers\EventsController;
|
||||
use App\Http\Controllers\TasksController;
|
||||
use App\Http\Controllers\NotificationsController;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\TasksController;
|
||||
|
||||
Route::get("/hello", function (Request $request) {
|
||||
return "Hello";
|
||||
@@ -44,3 +45,8 @@ Route::middleware(['web', 'auth:sanctum'])->post('/events/task', [TasksControlle
|
||||
Route::middleware(['web', 'auth:sanctum'])->post('/events/task/assign', [TasksController::class, "assignSelf"]);
|
||||
|
||||
Route::middleware(['web', 'auth:sanctum'])->post('/events/task/assign/{id}', [TasksController::class, "assignUser"]);
|
||||
|
||||
Route::post("/users/{id}/create/notification", [NotificationsController::class, "create"]);
|
||||
|
||||
Route::middleware(['web', 'auth:sanctum'])->get('/users/{id}/notifications', [NotificationsController::class, "getNotifications"]);
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@ post {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
X-XSRF-TOKEN:
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "{{name}}",
|
||||
@@ -22,8 +18,8 @@ body:json {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
name: Mon super event
|
||||
description: Ma super description
|
||||
name:
|
||||
description:
|
||||
}
|
||||
|
||||
assert {
|
||||
@@ -34,3 +30,16 @@ settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /events/create -- POST
|
||||
|
||||
Permet de créer un événement.
|
||||
|
||||
La connexion est obligatoire, les cookies de connexions/XSRF doivent être présents.
|
||||
|
||||
L'utilisateur doit être admin pour créer un événement
|
||||
|
||||
Entrée: nom, description
|
||||
|
||||
}
|
||||
|
||||
+2
-6
@@ -10,11 +10,6 @@ post {
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
X-XSRF-TOKEN:
|
||||
Accept: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "{{email}}",
|
||||
@@ -38,8 +33,9 @@ settings {
|
||||
}
|
||||
|
||||
docs {
|
||||
Permet de se connecter
|
||||
# /users/login -- POST
|
||||
|
||||
Permet de se connecter
|
||||
|
||||
Le header X-XSRF-TOKEN est obligatoire.
|
||||
Pour le récupérer:
|
||||
|
||||
+7
-5
@@ -10,11 +10,6 @@ post {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
X-XSRF-TOKEN:
|
||||
Accept: application/json
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
@@ -23,3 +18,10 @@ settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/logout -- POST
|
||||
|
||||
Permet de se déconnecter.
|
||||
Supprime le remember_token et cookies de connexions.
|
||||
}
|
||||
|
||||
@@ -10,10 +10,6 @@ post {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Accept: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "{{name}}",
|
||||
@@ -24,10 +20,10 @@ body:json {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
name: test
|
||||
email: test@test.com
|
||||
password: test
|
||||
lastname: NAME
|
||||
name:
|
||||
email:
|
||||
password:
|
||||
lastname:
|
||||
}
|
||||
|
||||
assert {
|
||||
@@ -40,5 +36,9 @@ settings {
|
||||
}
|
||||
|
||||
docs {
|
||||
Créer un utilisateur test
|
||||
# /users/register -- POST
|
||||
|
||||
Permet de créer un compte utilisateur.
|
||||
|
||||
Entrées: name, lastname, email, password
|
||||
}
|
||||
|
||||
@@ -5,16 +5,29 @@ meta {
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{url}}/api/users/7
|
||||
url: {{url}}/api/users/{{id}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
X-XSRF-TOKEN:
|
||||
vars:pre-request {
|
||||
id:
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/id -- DELETE
|
||||
|
||||
|
||||
Permet de supprimer un compte utilisateur
|
||||
|
||||
La connexion est obligatoire, les cookies de connexions/XSRF doivent être présents.
|
||||
|
||||
L'utilisateur doit être admin poir supprimer un autre compte utilisateur.
|
||||
|
||||
Entrée: id
|
||||
}
|
||||
|
||||
@@ -10,12 +10,15 @@ delete {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Accept: application/json
|
||||
X-XSRF-TOKEN:
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users -- DELETE
|
||||
|
||||
Permet de supprimer le compte de l'utilisateur actuellement connecté.
|
||||
|
||||
La connexion est obligatoire, les cookies de connexions/XSRF doivent être présents.
|
||||
}
|
||||
|
||||
@@ -5,19 +5,26 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/users/5
|
||||
url: {{url}}/api/users/{{id}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
id:
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/id -- GET
|
||||
|
||||
Permet de récupérer les informations d'un utilisateur.
|
||||
Authetification demandée
|
||||
Cookies de connexion/XSRF requis.
|
||||
|
||||
/api/users/{ID}
|
||||
|
||||
|
||||
@@ -5,16 +5,11 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{url}}/api/users/5/role
|
||||
url: {{url}}/api/users/{{id}}/role
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Accept: application/json
|
||||
X-XSRF-TOKEN:
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"role": {{role}}
|
||||
@@ -22,7 +17,8 @@ body:json {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
role: 2
|
||||
role:
|
||||
id:
|
||||
}
|
||||
|
||||
assert {
|
||||
@@ -33,3 +29,15 @@ settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/id/role -- POST
|
||||
|
||||
Permet de modifier le rôle d'un utilisateur.
|
||||
|
||||
La connexion est obligatoire, les cookies de connexions/XSRF doivent être présents.
|
||||
|
||||
L'utilisateur doit être admin pour modifier le rôle d'un utilisateur.
|
||||
|
||||
Entrées: id, role
|
||||
}
|
||||
|
||||
+11
-10
@@ -10,11 +10,6 @@ post {
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Accept: application/json
|
||||
X-XSRF-TOKEN:
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "{{name}}",
|
||||
@@ -24,9 +19,9 @@ body:json {
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
name: testUpdated
|
||||
lastname: testUpdated
|
||||
phone: 0607080910
|
||||
name:
|
||||
lastname:
|
||||
phone:
|
||||
}
|
||||
|
||||
assert {
|
||||
@@ -39,7 +34,13 @@ settings {
|
||||
}
|
||||
|
||||
docs {
|
||||
Permet de modifier le nom, le prenom et le numéro de téléphone de l'utilisateur
|
||||
# /users/update -- POST
|
||||
|
||||
le nom, le prenom et le numéro sont requis en entrée (même si pas modifié)
|
||||
Permet de modifier les données de l'utilisateur actuellement connecté.
|
||||
|
||||
La connexion est obligatoire, les cookies de connexions/XSRF doivent être présents.
|
||||
|
||||
Entrées: name, lastname, phone
|
||||
|
||||
Toutes les données d'entrées sont requises, même celles non modifiées.
|
||||
}
|
||||
|
||||
@@ -5,17 +5,28 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{url}}/api/users/5/validate
|
||||
url: {{url}}/api/users/{{id}}/validate
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Accept: application/json
|
||||
X-XSRF-TOKEN:
|
||||
vars:pre-request {
|
||||
id:
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users/id/validate -- POST
|
||||
|
||||
Permet de valider l'inscription d'un nouvel utilisateur.
|
||||
|
||||
La connexion est obligatoire, les cookies de connexions/XSRF doivent être présents.
|
||||
|
||||
L'utilisateur doit être admin pour valider un autre utilisateur
|
||||
|
||||
Entrée: id: identifiant de l'utilisateur qui va être validé.
|
||||
}
|
||||
|
||||
@@ -14,3 +14,9 @@ settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /users -- GET
|
||||
|
||||
Permet de récupérer tous les IDs des utilisateurs.
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
headers {
|
||||
Accept: application/json
|
||||
X-XSRF-TOKEN:
|
||||
}
|
||||
|
||||
@@ -18,3 +18,9 @@ settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /csrf-cookie -- GET
|
||||
|
||||
Renvoi le cookie XSRF permettant de se connecter et de faire des requêtes afin d'éviter les failles CSRF.
|
||||
}
|
||||
|
||||
+11
-5
@@ -5,15 +5,11 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{url}}/api/me
|
||||
url: {{url}}/api/users/me
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Accept: application/json
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
}
|
||||
@@ -22,3 +18,13 @@ settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
# /me -- GET
|
||||
|
||||
Renvoi l'utilisateur acutllement connecté.
|
||||
|
||||
La connexion est obligatoire, les cookies de connexions/XSRF doivent être présents.
|
||||
|
||||
Renvoi un objet avec les informations de l'utilisateur
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user