fix: use hash-router URL format for listing links in email adapters (#335)

The UI is served through a HashRouter, and most adapters (telegram,
slack, discord, ntfy, ...) already link to ${baseUrl}/#/listings/listing/:id.
The email adapters (resend, smtp, mailJet, sendGrid) and the http adapter
were missing the /# - the router never saw the route and dumped the user
on the default overview instead of the listing.
This commit is contained in:
Michel
2026-06-10 16:38:36 +02:00
committed by GitHub
parent bc9c56a224
commit 359e00e69f
5 changed files with 5 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ const mapListing = (listing, baseUrl) => ({
size: listing.size, size: listing.size,
title: listing.title, title: listing.title,
url: listing.link, url: listing.link,
fredyUrl: baseUrl && listing.id ? `${baseUrl}/listings/listing/${listing.id}` : null, fredyUrl: baseUrl && listing.id ? `${baseUrl}/#/listings/listing/${listing.id}` : null,
}); });
export const send = async ({ serviceName, newListings, notificationConfig, jobKey, baseUrl }) => { export const send = async ({ serviceName, newListings, notificationConfig, jobKey, baseUrl }) => {

View File

@@ -53,7 +53,7 @@ const mapListingsWithCid = async (serviceName, jobKey, listings, baseUrl) => {
jobKey, jobKey,
hasImage: false, hasImage: false,
imageCid: '', imageCid: '',
fredyUrl: baseUrl && l.id ? `${baseUrl}/listings/listing/${l.id}` : null, fredyUrl: baseUrl && l.id ? `${baseUrl}/#/listings/listing/${l.id}` : null,
}; };
if (imgUrl) { if (imgUrl) {

View File

@@ -25,7 +25,7 @@ const mapListings = (serviceName, jobKey, listings, baseUrl) =>
price: l.price || '', price: l.price || '',
image, image,
hasImage: Boolean(image), hasImage: Boolean(image),
fredyUrl: baseUrl && l.id ? `${baseUrl}/listings/listing/${l.id}` : null, fredyUrl: baseUrl && l.id ? `${baseUrl}/#/listings/listing/${l.id}` : null,
serviceName, serviceName,
jobKey, jobKey,
}; };

View File

@@ -20,7 +20,7 @@ const mapListings = (serviceName, jobKey, listings, baseUrl) =>
hasImage: Boolean(image), hasImage: Boolean(image),
// optional plain text snippet // optional plain text snippet
snippet: [l.address, l.price, l.size].filter(Boolean).join(' | '), snippet: [l.address, l.price, l.size].filter(Boolean).join(' | '),
fredyUrl: baseUrl && l.id ? `${baseUrl}/listings/listing/${l.id}` : null, fredyUrl: baseUrl && l.id ? `${baseUrl}/#/listings/listing/${l.id}` : null,
serviceName, serviceName,
jobKey, jobKey,
}; };

View File

@@ -25,7 +25,7 @@ const mapListings = (serviceName, jobKey, listings, baseUrl) =>
price: l.price || '', price: l.price || '',
image, image,
hasImage: Boolean(image), hasImage: Boolean(image),
fredyUrl: baseUrl && l.id ? `${baseUrl}/listings/listing/${l.id}` : null, fredyUrl: baseUrl && l.id ? `${baseUrl}/#/listings/listing/${l.id}` : null,
serviceName, serviceName,
jobKey, jobKey,
}; };