[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-10-28 23:00:17 +01:00
committed by Hootan
parent a0c87358eb
commit 970905198b
3 changed files with 13 additions and 7 deletions
@@ -361,7 +361,8 @@ export const sendDatabaseBackupNotifications = async ({
if (mattermost) { if (mattermost) {
const statusEmoji = type === "success" ? "✅" : "❌"; const statusEmoji = type === "success" ? "✅" : "❌";
const typeStatus = type === "success" ? "Successful" : "Failed"; const typeStatus = type === "success" ? "Successful" : "Failed";
const errorMsg = type === "error" && errorMessage const errorMsg =
type === "error" && errorMessage
? `\n\n**Error:**\n\`\`\`\n${errorMessage}\n\`\`\`` ? `\n\n**Error:**\n\`\`\`\n${errorMessage}\n\`\`\``
: ""; : "";
@@ -163,9 +163,13 @@ export const sendMattermostNotification = async (
const payload = { const payload = {
...message, ...message,
// Only include username if it's provided and not empty // 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 // 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, { await fetch(connection.webhookUrl, {
@@ -176,6 +180,7 @@ export const sendMattermostNotification = async (
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} }
};
export const sendLarkNotification = async ( export const sendLarkNotification = async (
connection: typeof lark.$inferInsert, connection: typeof lark.$inferInsert,