diff --git a/src/routes/dashboard.js b/src/routes/dashboard.js index 49446c8..170aceb 100644 --- a/src/routes/dashboard.js +++ b/src/routes/dashboard.js @@ -433,20 +433,20 @@ export const dashboardRoutes = (fastify, _, done) => { }); } - if (site.auto_publish !== req.body.auto_publish) { - const [user] = await db.select().from(users).where(eq(users.id, req.session.user_id)); - if (!user) throw new Error("Problem getting user"); - let form = new FormData(); - form.set("hub.callback", env.PUBLIC_API_URL + "/webhooks/youtube"); - form.set("hub.topic", "https://www.youtube.com/xml/feeds/videos.xml?channel_id=" + user.channel_id); - form.set("hub.verify", "async"); - form.set("hub.mode", req.body.auto_publish ? "subscribe" : "unsubscribe"); - form.set("hub.verify_token", websubVerifyToken); - await fetch("https://pubsubhubbub.appspot.com/subscribe", { - method: "POST", - body: form - }); - } + // if (site.auto_publish !== req.body.auto_publish) { + // const [user] = await db.select().from(users).where(eq(users.id, req.session.user_id)); + // if (!user) throw new Error("Problem getting user"); + // let form = new FormData(); + // form.set("hub.callback", env.PUBLIC_API_URL + "/webhooks/youtube"); + // form.set("hub.topic", "https://www.youtube.com/xml/feeds/videos.xml?channel_id=" + user.channel_id); + // form.set("hub.verify", "async"); + // form.set("hub.mode", req.body.auto_publish ? "subscribe" : "unsubscribe"); + // form.set("hub.verify_token", websubVerifyToken); + // await fetch("https://pubsubhubbub.appspot.com/subscribe", { + // method: "POST", + // body: form + // }); + // } const data = structuredClone(req.body);