redirect to the account page :3

This commit is contained in:
ashley 2024-05-11 02:37:03 +00:00
parent d7ef10b65e
commit c49abee128

View file

@ -70,17 +70,17 @@ app.get("/api/set-channel-subs", async function (req, res) {
channelName: channelToSubName,
avatar: avatar, // Store the avatar URL along with the subscription
});
res.json("user subbed");
res.redirect("/account-create")
} else if (!db.get(`user.${userid}.subs.${channelToSub}`)) {
// If the user has 'subs' but not this particular subscription, add it
db.set(`user.${userid}.subs.${channelToSub}`, {
channelName: channelToSubName,
avatar: avatar, // Store the avatar URL along with the subscription
});
res.json("user subbed");
res.redirect("/account-create")
} else {
// If the user is already subscribed to this channel, send a message indicating so
res.json("user already subscribed");
res.json("ur already subscribed");
}
});
@ -109,7 +109,7 @@ app.get("/my-acc", async function (req, res) {
// Check if userid is more than 6 characters
if (userid.length > 6) {
return res.status(400).json({ error: "IDs can be 6 characters max" });
return res.status(400).json({ error: "IDs can be 6 characters max silly :3" });
}
var userSubs = db.get(`user.${userid}.subs`);