Skip to content

Commit

Permalink
refactor(core/api/dev-template): remove initial locale and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vanbasten17 committed Oct 22, 2021
1 parent f231f45 commit e30f690
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/botonic-api/src/rest/routes/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function eventsRouter(args: any): Router {
})
await handlers.run('botExecutor', {
input: { ...message, userId }, // To identify user executing the input
session: updatedUser.session,
session: user.session,
botState: user.botState,
websocketId: user.websocketId,
})
Expand Down
7 changes: 4 additions & 3 deletions packages/botonic-core/src/handoff.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'

import { PATH_PAYLOAD_IDENTIFIER } from './constants'
import { Session } from './models'
import { BotState, Session } from './models'

const HUBTYPE_API_URL = 'https://api.hubtype.com'

Expand Down Expand Up @@ -257,14 +257,15 @@ export async function getAgentVacationRanges(
}

export function cancelHandoff(
botState: any,
botState: BotState,
typification: string | null = null
): void {
let action = 'discard_case'
if (typification) action = `${action}:${JSON.stringify({ typification })}`
botState.botonicAction = action
botState.isHandoff = false // TODO: Review handoff functionalities
}

export function deleteUser(botState: any): void {
export function deleteUser(botState: BotState): void {
botState.botonicAction = `delete_user`
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const initialBotState = {
lastRoutePath: null,
isFirstInteraction: true,
retries: 0,
locale: 'en',
isHandoff: false,
isShadowing: false,
}
Expand Down

0 comments on commit e30f690

Please sign in to comment.