summaryrefslogtreecommitdiffstats
path: root/src/routes/model.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/model.rs')
-rw-r--r--src/routes/model.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/routes/model.rs b/src/routes/model.rs
index bc66d25..98e41dc 100644
--- a/src/routes/model.rs
+++ b/src/routes/model.rs
@@ -5,6 +5,7 @@ use crate::models::{
model::{Model, ModelCreate, ModelUpload, ModelUser},
};
use crate::pagination::Pagination;
+use crate::routes::JsonCreate;
use axum::{
extract::{ContentLengthLimit, Multipart, Path, Query},
routing::{get, post},
@@ -39,7 +40,7 @@ async fn list_models(pagination: Query<Pagination>) -> Result<Json<ModelPaginati
async fn create_model(
Json(payload): Json<ModelCreate>,
claims: Claims,
-) -> Result<Json<Model>, AppError> {
+) -> Result<JsonCreate<Model>, AppError> {
let model = Model::new(
payload.name,
payload.description,
@@ -53,7 +54,7 @@ async fn create_model(
let model_new = Model::create(model).await?;
- Ok(Json(model_new))
+ Ok(JsonCreate(model_new))
}
/// Get a model with id = `model_id`