mirror of
https://github.com/lldap/lldap.git
synced 2026-07-25 17:58:44 +00:00
app: Fix attribute type parsing
This commit is contained in:
committed by
nitnelave
parent
3c7e4c3dec
commit
363ef106e2
@@ -69,7 +69,7 @@ impl CommonComponent<CreateGroupAttributeForm> for CreateGroupAttributeForm {
|
||||
);
|
||||
})?;
|
||||
let attribute_type =
|
||||
serde_json::from_str::<AttributeType>(&model.attribute_type).unwrap();
|
||||
AttributeType::try_from(model.attribute_type.as_str()).unwrap();
|
||||
let req = create_group_attribute::Variables {
|
||||
name: model.attribute_name,
|
||||
attribute_type,
|
||||
@@ -144,7 +144,7 @@ impl Component for CreateGroupAttributeForm {
|
||||
oninput={link.callback(|_| Msg::Update)}>
|
||||
<option selected=true value="String">{"String"}</option>
|
||||
<option value="Integer">{"Integer"}</option>
|
||||
<option value="Jpeg">{"Jpeg"}</option>
|
||||
<option value="JpegPhoto">{"Jpeg"}</option>
|
||||
<option value="DateTime">{"DateTime"}</option>
|
||||
</Select<CreateGroupAttributeModel>>
|
||||
<CheckBox<CreateGroupAttributeModel>
|
||||
|
||||
@@ -73,7 +73,7 @@ impl CommonComponent<CreateUserAttributeForm> for CreateUserAttributeForm {
|
||||
);
|
||||
})?;
|
||||
let attribute_type =
|
||||
serde_json::from_str::<AttributeType>(&model.attribute_type).unwrap();
|
||||
AttributeType::try_from(model.attribute_type.as_str()).unwrap();
|
||||
let req = create_user_attribute::Variables {
|
||||
name: model.attribute_name,
|
||||
attribute_type,
|
||||
@@ -146,7 +146,7 @@ impl Component for CreateUserAttributeForm {
|
||||
oninput={link.callback(|_| Msg::Update)}>
|
||||
<option selected=true value="String">{"String"}</option>
|
||||
<option value="Integer">{"Integer"}</option>
|
||||
<option value="Jpeg">{"Jpeg"}</option>
|
||||
<option value="JpegPhoto">{"Jpeg"}</option>
|
||||
<option value="DateTime">{"DateTime"}</option>
|
||||
</Select<CreateUserAttributeModel>>
|
||||
<CheckBox<CreateUserAttributeModel>
|
||||
|
||||
Reference in New Issue
Block a user