diff --git a/backend/windmill-api/src/postgres_triggers/handler.rs b/backend/windmill-api/src/postgres_triggers/handler.rs index 69fe8604f2..fcb5a934ff 100644 --- a/backend/windmill-api/src/postgres_triggers/handler.rs +++ b/backend/windmill-api/src/postgres_triggers/handler.rs @@ -30,9 +30,10 @@ use windmill_common::{ }; use super::{ - create_logical_replication_slot_query, create_publication_query, drop_publication_query, - generate_random_string, get_database_connection, get_raw_postgres_connection, - ERROR_PUBLICATION_NAME_NOT_EXISTS, ERROR_REPLICATION_SLOT_NOT_EXISTS, + create_logical_replication_slot_query, create_publication_query, + drop_logical_replication_slot_query, drop_publication_query, generate_random_string, + get_database_connection, get_raw_postgres_connection, ERROR_PUBLICATION_NAME_NOT_EXISTS, + ERROR_REPLICATION_SLOT_NOT_EXISTS, }; use lazy_static::lazy_static; diff --git a/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte b/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte index 29172d031a..9ed430bcee 100644 --- a/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte +++ b/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte @@ -35,7 +35,6 @@ export let publication: PublicationData = DEFAULT_PUBLICATION function updateValidity(publication: PublicationData) { - console.log({ publication }) isValid = !emptyString(postgres_resource_path) && (!publication.table_to_track || publication.table_to_track.length === 0) diff --git a/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte b/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte index 4956808907..988152f00c 100644 --- a/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte +++ b/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte @@ -45,7 +45,7 @@ let postgres_resource_path = '' let publication_name: string = '' let replication_slot_name: string = '' - let relations: Relations[] = [] + let relations: Relations[] | undefined = [] let transaction_to_track: string[] = [] let language: Language = 'Typescript' let loading = false @@ -247,11 +247,10 @@ } const getTemplateScript = async () => { - if (relations.length === 0 || emptyString(postgres_resource_path)) { + if (!relations || relations.length === 0 || emptyString(postgres_resource_path)) { sendUserToast('You must pick a database resource and choose at least one schema', true) return } - try { loading = true let templateId = await PostgresTriggerService.createTemplateScript({ @@ -359,7 +358,7 @@ allowRefresh /> - {#if script_path === undefined && is_flow === false} + {#if emptyStringTrimmed(script_path) && is_flow === false}