init
This commit is contained in:
@@ -8,15 +8,12 @@ pub struct CreateCategoryRequest {
|
||||
pub server_id: Uuid,
|
||||
#[schema(example = "Discussion")]
|
||||
pub name: String,
|
||||
#[serde(default)]
|
||||
pub position: i32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
||||
pub struct UpdateCategoryRequest {
|
||||
#[schema(example = "Discussion (Maj)")]
|
||||
pub name: String,
|
||||
pub position: i32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
||||
@@ -24,7 +21,6 @@ pub struct CategoryResponse {
|
||||
pub id: Uuid,
|
||||
pub server_id: Uuid,
|
||||
pub name: String,
|
||||
pub position: i32,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ pub fn category_model_to_category_response(model: category::Model) -> CategoryRe
|
||||
id: model.id,
|
||||
server_id: model.server_id,
|
||||
name: model.name,
|
||||
position: model.position,
|
||||
created_at: model.created_at,
|
||||
updated_at: model.updated_at,
|
||||
}
|
||||
@@ -21,7 +20,6 @@ pub fn create_request_to_am(req: CreateCategoryRequest) -> category::ActiveModel
|
||||
id: Set(Uuid::new_v4()),
|
||||
server_id: Set(req.server_id),
|
||||
name: Set(req.name),
|
||||
position: Set(req.position),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
@@ -35,7 +33,6 @@ pub fn update_request_to_am(
|
||||
id: Set(id),
|
||||
server_id: Set(server_id),
|
||||
name: Set(req.name),
|
||||
position: Set(req.position),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user