integrate-gitea (#2)
Reviewed-on: #2 Co-authored-by: Julien Fastré <julien.fastre@champs-libres.coop> Co-committed-by: Julien Fastré <julien.fastre@champs-libres.coop>
This commit is contained in:
@@ -11,8 +11,11 @@ pub struct UserLink {
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
pub struct User {
|
||||
#[serde(rename = "_type")]
|
||||
#[allow(unused_variables)]
|
||||
pub d_type: String,
|
||||
#[allow(unused_variables)]
|
||||
pub id: u64,
|
||||
#[allow(unused_variables)]
|
||||
pub name: String,
|
||||
#[serde(rename = "_links")]
|
||||
pub d_links: UserLink,
|
||||
|
@@ -1,4 +1,5 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::openproject::user::User;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct WorkPackageWriterAssignee {
|
||||
@@ -24,3 +25,14 @@ pub struct WorkPackage {
|
||||
pub id: u64,
|
||||
pub subject: String,
|
||||
}
|
||||
|
||||
impl From<Option<User>> for WorkPackageWriterAssignee {
|
||||
fn from(value: Option<User>) -> Self {
|
||||
WorkPackageWriterAssignee {
|
||||
href: match value {
|
||||
None => None,
|
||||
Some(w) => Some(w.clone().d_links.d_self.href),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user