🩹 back: tolerate extraneous /s in env vars

This commit is contained in:
Eric Doughty-Papassideris
2024-11-16 06:08:56 +01:00
committed by Anton Shepilov
parent 00f819fb6d
commit dcadfa4231
2 changed files with 26 additions and 1 deletions
@@ -16,6 +16,7 @@ import path from "path";
import { existsSync } from "fs";
import axios from "axios";
import short, { Translator } from "short-uuid";
import { joinURL } from "../../../../utils/urls";
export default class EmailPusherClass
extends TdriveService<EmailPusherAPI>
@@ -86,7 +87,14 @@ export default class EmailPusherClass
const encodedCompanyId = translator.fromUUID(data.notifications[0].item.company_id);
const encodedItemId = translator.fromUUID(data.notifications[0].item.id);
const previewType = data.notifications[0].item.is_directory ? "d" : "preview";
const encodedUrl = `${this.platformUrl}/client/${encodedCompanyId}/v/shared_with_me/${previewType}/${encodedItemId}`;
const encodedUrl = joinURL([
this.platformUrl,
"client",
encodedCompanyId,
"v/shared_with_me",
previewType,
encodedItemId,
]);
if (!existsSync(templatePath)) {
throw Error(`template not found: ${templatePath}`);