Send response action also for delete events
When TUI user invoked delete event we want to know it was completed successfully. For that send a response with request data and explicit Null as response. Change-Id: I844d2d89883481b4a874aadf4aee8156c84cf536
This commit is contained in:
parent
39bdf3bdae
commit
8995fa42b2
@ -162,8 +162,8 @@ impl ExecuteApiRequest for {{ class_name }} {
|
|||||||
async fn execute_request(
|
async fn execute_request(
|
||||||
&self,
|
&self,
|
||||||
session: &mut AsyncOpenStack,
|
session: &mut AsyncOpenStack,
|
||||||
{{ "_" if operation_type == "delete" else ""}}request: &ApiRequest,
|
request: &ApiRequest,
|
||||||
{{ "_" if operation_type == "delete" else ""}}app_tx: &UnboundedSender<Action>,
|
app_tx: &UnboundedSender<Action>,
|
||||||
) -> Result<(), CloudWorkerError> {
|
) -> Result<(), CloudWorkerError> {
|
||||||
let ep = TryInto::<RequestBuilder>::try_into(self)?
|
let ep = TryInto::<RequestBuilder>::try_into(self)?
|
||||||
.build()
|
.build()
|
||||||
@ -189,6 +189,11 @@ impl ExecuteApiRequest for {{ class_name }} {
|
|||||||
})?;
|
})?;
|
||||||
{%- elif operation_type == "delete" %}
|
{%- elif operation_type == "delete" %}
|
||||||
ignore(ep).query_async(session).await?;
|
ignore(ep).query_async(session).await?;
|
||||||
|
// Let caller know deletion was completed
|
||||||
|
app_tx.send(Action::ApiResponseData {
|
||||||
|
request: request.clone(),
|
||||||
|
data: serde_json::Value::Null,
|
||||||
|
})?;
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user