[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-09-30 05:05:28 +00:00
committed by Hootan
parent a0c87358eb
commit 970905198b
3 changed files with 13 additions and 7 deletions

View File

@@ -361,9 +361,10 @@ export const sendDatabaseBackupNotifications = async ({
if (mattermost) {
const statusEmoji = type === "success" ? "✅" : "❌";
const typeStatus = type === "success" ? "Successful" : "Failed";
const errorMsg = type === "error" && errorMessage
? `\n\n**Error:**\n\`\`\`\n${errorMessage}\n\`\`\``
: "";
const errorMsg =
type === "error" && errorMessage
? `\n\n**Error:**\n\`\`\`\n${errorMessage}\n\`\`\``
: "";
await sendMattermostNotification(mattermost, {
text: `**${statusEmoji} Database Backup ${typeStatus}**\n\n**Project:** ${projectName}\n**Application:** ${applicationName}\n**Type:** ${databaseType}\n**Database Name:** ${databaseName}\n**Date:** ${format(date, "PP")}\n**Time:** ${format(date, "pp")}${errorMsg}`,

View File

@@ -163,9 +163,13 @@ export const sendMattermostNotification = async (
const payload = {
...message,
// Only include username if it's provided and not empty
...(message.username && message.username.trim() && { username: message.username }),
...(message.username &&
message.username.trim() && { username: message.username }),
// Only include wchannel if it's provided and not empty
...(message.channel && message.channel.trim() && { channel: `#${message.channel.replace('#', '')}` }),
...(message.channel &&
message.channel.trim() && {
channel: `#${message.channel.replace("#", "")}`,
}),
};
await fetch(connection.webhookUrl, {
@@ -176,6 +180,7 @@ export const sendMattermostNotification = async (
} catch (err) {
console.log(err);
}
};
export const sendLarkNotification = async (
connection: typeof lark.$inferInsert,