Skip to content

Commit

Permalink
fix: issue in workflow invoker action params
Browse files Browse the repository at this point in the history
  • Loading branch information
shanithkk committed May 12, 2024
1 parent f2a48b9 commit 514a067
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actions/workflow-invoker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Action {
}

pub fn fetch_input(&mut self) -> Result<Vec<UserData>, Error> {
let id = self.params.messages.clone()[0].topic.clone();
let id: String = self.params.messages.clone()[0].topic.clone();
let data = self.get_context().get_document(&id)?;
let parsed = serde_json::from_value::<Topic>(data)?;
Ok(parsed.data)
Expand Down Expand Up @@ -93,14 +93,14 @@ impl Action {
Ok(action_name)
}

pub fn invoke_action(&mut self, payload: &mut Vec<Value>) -> Result<Value, Error> {
pub fn invoke_action(&mut self, payload: &mut [UserData]) -> Result<Value, Error> {
let mut failed_actions = vec![];

let action_name = self.get_action_name().unwrap();

for message in payload.iter_mut() {
let data = serde_json::from_str::<Value>(&self.params.messages[0].value).unwrap();
update_with(&mut user.input_data, &data);
update_with(&mut message.input_data, &data);

if self
.get_context()
Expand Down

0 comments on commit 514a067

Please sign in to comment.