fix(notifications): update Mattermost notification handling

- Changed webhookUrl validation to ensure it is a valid URL.
- Updated input types for createMattermostNotification and updateMattermostNotification functions to use z.infer for better type inference.
- Refactored sendMattermostNotification to improve error handling and payload construction.
This commit is contained in:
Mauricio Siu
2026-03-24 12:39:38 -06:00
parent 58b9a0d3d0
commit d6056972f4
3 changed files with 22 additions and 22 deletions

View File

@@ -494,7 +494,7 @@ export const apiCreateMattermost = notificationsSchema
serverThreshold: true,
})
.extend({
webhookUrl: z.string().min(1),
webhookUrl: z.string().url(),
channel: z.string().optional(),
username: z.string().optional(),
})