增强后端 TypeScript 严格类型检查
This commit is contained in:
@@ -26,9 +26,9 @@ export async function notifyInternalSafely(payload: InternalNotificationPayload)
|
||||
try {
|
||||
const result = await sendInternalNotification({
|
||||
title: payload.title,
|
||||
body: payload.body,
|
||||
category: payload.category,
|
||||
url: payload.url,
|
||||
...(payload.body !== undefined ? { body: payload.body } : {}),
|
||||
...(payload.category !== undefined ? { category: payload.category } : {}),
|
||||
...(payload.url !== undefined ? { url: payload.url } : {}),
|
||||
})
|
||||
markNotificationCooldown(cooldownKey)
|
||||
return result
|
||||
|
||||
@@ -40,12 +40,12 @@ export async function sendInternalNotification(input: NotificationInput = {}) {
|
||||
...(await Promise.all(barkRecipients.map(async (recipient: JsonObject) => {
|
||||
try {
|
||||
const result = await sendBarkNotification({
|
||||
serverUrl: bark.serverUrl,
|
||||
recipient,
|
||||
title,
|
||||
body,
|
||||
group: `订单系统/${category}`,
|
||||
url: input.url,
|
||||
...(bark.serverUrl !== undefined ? { serverUrl: bark.serverUrl } : {}),
|
||||
...(input.url !== undefined ? { url: input.url } : {}),
|
||||
})
|
||||
return mapNotificationResult('bark', recipient, recipient.deviceKey, true, '', result.status, result.response)
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user