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(
|
||||
&self,
|
||||
session: &mut AsyncOpenStack,
|
||||
{{ "_" if operation_type == "delete" else ""}}request: &ApiRequest,
|
||||
{{ "_" if operation_type == "delete" else ""}}app_tx: &UnboundedSender<Action>,
|
||||
request: &ApiRequest,
|
||||
app_tx: &UnboundedSender<Action>,
|
||||
) -> Result<(), CloudWorkerError> {
|
||||
let ep = TryInto::<RequestBuilder>::try_into(self)?
|
||||
.build()
|
||||
@ -189,6 +189,11 @@ impl ExecuteApiRequest for {{ class_name }} {
|
||||
})?;
|
||||
{%- elif operation_type == "delete" %}
|
||||
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 %}
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user