refactoring
This commit is contained in:
@@ -99,6 +99,20 @@ async function sendSlotNotification({ profileId, storeName, pickupDate, onlyNoti
|
||||
});
|
||||
}
|
||||
|
||||
async function sendStoreWatchNotification({ profileId, storeName, storeId, regionName }) {
|
||||
const storeLink = storeId ? `https://foodsharing.de/store/${storeId}` : null;
|
||||
const title = `Team sucht Verstärkung: ${storeName}`;
|
||||
const regionText = regionName ? ` (${regionName})` : '';
|
||||
const messageBase = `Der Betrieb${regionText} sucht wieder aktiv neue Teammitglieder.`;
|
||||
const message = storeLink ? `${messageBase}\n${storeLink}` : messageBase;
|
||||
await notifyChannels(profileId, {
|
||||
title,
|
||||
message,
|
||||
link: storeLink,
|
||||
priority: 'high'
|
||||
});
|
||||
}
|
||||
|
||||
async function sendTestNotification(profileId, channel) {
|
||||
const title = 'Pickup Benachrichtigung (Test)';
|
||||
const message = 'Das ist eine Testnachricht. Bei Fragen wende dich bitte an den Admin.';
|
||||
@@ -134,5 +148,6 @@ async function sendTestNotification(profileId, channel) {
|
||||
|
||||
module.exports = {
|
||||
sendSlotNotification,
|
||||
sendStoreWatchNotification,
|
||||
sendTestNotification
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user