Init
This commit is contained in:
@@ -7,6 +7,7 @@ use uuid::Uuid;
|
||||
pub struct UserResponse {
|
||||
pub id: Uuid,
|
||||
pub username: String,
|
||||
pub pub_key: String,
|
||||
}
|
||||
|
||||
impl From<user::Model> for UserResponse {
|
||||
@@ -14,6 +15,7 @@ impl From<user::Model> for UserResponse {
|
||||
Self {
|
||||
id: model.id,
|
||||
username: model.username,
|
||||
pub_key: model.pub_key,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,3 +33,10 @@ impl From<CreateUserRequest> for user::ActiveModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl CreateUserRequest {
|
||||
pub fn apply_to(self, mut am: user::ActiveModel) -> user::ActiveModel {
|
||||
am.username = Set(self.username);
|
||||
am
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user