Fix: ntfy delete correct topic usage

This commit is contained in:
2025-11-10 13:42:46 -08:00
parent c51b7d25b7
commit 72aeb573b2

View File

@@ -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