From 72aeb573b2330a4ab9b10fd10950c3631400a742 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 10 Nov 2025 13:42:46 -0800 Subject: [PATCH] Fix: ntfy delete correct topic usage --- functions/api/links/delete.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/functions/api/links/delete.js b/functions/api/links/delete.js index e68bfc8..c341de0 100644 --- a/functions/api/links/delete.js +++ b/functions/api/links/delete.js @@ -1,15 +1,15 @@ -const ntfy = (env,topic,title,msg,p=2) => - env.NTFY_TOPIC ? - fetch(`https://ntfy.sh/${topic}`,{ - method:"POST", - headers:{ - "Title":`🗑️ ${title}`, - "Priority":String(p), - "Content-Type":"text/plain" - }, - body:msg - }).catch(()=>{}) : - Promise.resolve(); +const ntfy = (env,title,msg,p=2) => + env.NTFY_TOPIC + ? fetch(`https://ntfy.sh/${env.NTFY_TOPIC}`,{ + method:"POST", + headers:{ + "Title":`🗑️ ${title}`, + "Priority":String(p), + "Content-Type":"text/plain" + }, + body:msg + }).catch(()=>{}) + : Promise.resolve(); export async function onRequestPost({ request, env }) { try { @@ -50,7 +50,6 @@ export async function onRequestPost({ request, env }) { .run(), ntfy( env, - env.NTFY_TOPIC, "link-delete", `event=delete\nuser=${username}\nslug=${slug}`, 2