init
This commit is contained in:
@@ -72,7 +72,10 @@ pub async fn get_by_id(
|
||||
(status = 404, description = "Serveur non trouvé"),
|
||||
(status = 500, description = "Erreur interne du serveur")
|
||||
),
|
||||
tag = "Categories"
|
||||
tag = "Categories",
|
||||
security(
|
||||
("bearerAuth" = [])
|
||||
)
|
||||
)]
|
||||
pub async fn create(
|
||||
_admin: Superuser,
|
||||
@@ -108,7 +111,10 @@ pub async fn create(
|
||||
params(
|
||||
("id" = Uuid, Path, description = "ID de la catégorie")
|
||||
),
|
||||
tag = "Categories"
|
||||
tag = "Categories",
|
||||
security(
|
||||
("bearerAuth" = [])
|
||||
)
|
||||
)]
|
||||
pub async fn update(
|
||||
_admin: Superuser,
|
||||
@@ -142,7 +148,10 @@ pub async fn update(
|
||||
params(
|
||||
("id" = Uuid, Path, description = "ID de la catégorie")
|
||||
),
|
||||
tag = "Categories"
|
||||
tag = "Categories",
|
||||
security(
|
||||
("bearerAuth" = [])
|
||||
)
|
||||
)]
|
||||
pub async fn delete(
|
||||
_admin: Superuser,
|
||||
|
||||
@@ -7,7 +7,7 @@ pub fn router() -> Router<AppState> {
|
||||
Router::new()
|
||||
.route("/categories", get(handlers::get_all).post(handlers::create))
|
||||
.route(
|
||||
"/categories/:id",
|
||||
"/categories/{id}",
|
||||
get(handlers::get_by_id)
|
||||
.put(handlers::update)
|
||||
.delete(handlers::delete),
|
||||
|
||||
Reference in New Issue
Block a user