Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
fix: repromptactionid not updated (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsLiden authored Dec 3, 2019
1 parent f691a35 commit 022ecf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/actions/actionActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export const createActionThunkAsync = (appId: string, action: ActionBase) => {
const clClient = ClientFactory.getInstance(AT.CREATE_ACTION_ASYNC)

try {
const newAction = await clClient.actionsCreate(appId, action);
dispatch(createActionFulfilled(newAction));
return newAction;
const newAction = await clClient.actionsCreate(appId, action)
dispatch(createActionFulfilled(newAction))
return newAction
} catch (e) {
const error = e as AxiosError
dispatch(setErrorDisplay(ErrorType.Error, error.message, error.response ? JSON.stringify(error.response, null, ' ') : "", AT.CREATE_ACTION_ASYNC))
Expand Down
6 changes: 5 additions & 1 deletion src/services/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
import * as CLM from '@conversationlearner/models'
import { PartialTrainDialog } from '../types/models'
import { REPROMPT_SELF } from '../types/const'
import Axios, { AxiosRequestConfig, AxiosResponse } from 'axios'
import * as querystring from 'query-string'

Expand Down Expand Up @@ -305,7 +306,10 @@ export default class ClClient {
url: `/app/${appId}/action`,
data: action
})
action.actionId = response.data.actionId;
action.actionId = response.data.actionId
if (action.repromptActionId === REPROMPT_SELF) {
action.repromptActionId = action.actionId
}
return action
}

Expand Down

0 comments on commit 022ecf8

Please sign in to comment.