mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
chore: adjust TriggerType for OpenAI and Typebot integrations
Modifies the TriggerType enum to include a 'none' option and updates the OpenAI and Typebot services to handle this new option. Additionally, the services now require a trigger operator and value when the trigger type is set to 'keyword'. Modified files: - prisma/postgresql-schema.prisma - src/api/integrations/openai/services/openai.service.ts - src/api/integrations/typebot/services/typebot.service.ts Untracked file: - prisma/migrations/20240729115127_modify_trigger_type_openai_typebot_table/
This commit is contained in:
parent
f95d34a1da
commit
d00e3677f5
@ -0,0 +1,2 @@
|
||||
-- AlterEnum
|
||||
ALTER TYPE "TriggerType" ADD VALUE 'none';
|
@ -36,6 +36,7 @@ enum TypebotSessionStatus {
|
||||
enum TriggerType {
|
||||
all
|
||||
keyword
|
||||
none
|
||||
}
|
||||
|
||||
enum TriggerOperator {
|
||||
|
@ -212,7 +212,7 @@ export class OpenaiService {
|
||||
throw new Error('Openai Bot already exists');
|
||||
}
|
||||
|
||||
if (data.triggerType !== 'all') {
|
||||
if (data.triggerType === 'keyword') {
|
||||
if (!data.triggerOperator || !data.triggerValue) {
|
||||
throw new Error('Trigger operator and value are required');
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ export class TypebotService {
|
||||
throw new Error('Typebot already exists');
|
||||
}
|
||||
|
||||
if (data.triggerType !== 'all') {
|
||||
if (data.triggerType === 'keyword') {
|
||||
if (!data.triggerOperator || !data.triggerValue) {
|
||||
throw new Error('Trigger operator and value are required');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user