Fix: Ensure full Slack connector configuration is saved

I've modified `useConnectorEditPage.ts` to correctly save all Slack connector settings.

- I updated `editConnectorSchema` in `types.ts` to include a `config` field in `EditConnectorFormValues`.
- I replaced the `handleSaveChanges` function in `useConnectorEditPage.ts` with a version that reads the complete Slack configuration from `formData.config` (populated by `EditSlackConnectorConfigForm` and channel selection).
- This ensures that settings like `slack_selected_channel_ids`, `slack_membership_filter_type`, and other Slack-specific options are included in the payload to the backend and persisted correctly.
- I updated post-save logic to correctly reset the form's `config` field for Slack connectors.

This addresses the issue where changes to Slack connector configurations, other than just the bot token, were not being saved.
This commit is contained in:
google-labs-jules[bot] 2025-05-29 06:37:35 +00:00
parent 9fc5f6589b
commit 95b3d97800
2 changed files with 153 additions and 73 deletions

View file

@ -31,5 +31,6 @@ export const editConnectorSchema = z.object({
TAVILY_API_KEY: z.string().optional(),
LINEAR_API_KEY: z.string().optional(),
LINKUP_API_KEY: z.string().optional(),
config: z.record(z.string(), z.any()).optional(), // Added for generic config object
});
export type EditConnectorFormValues = z.infer<typeof editConnectorSchema>;