1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 05:34:40 -05:00

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, channelName: channelToSubName,
avatar: avatar, // Store the avatar URL along with the subscription 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}`)) { } else if (!db.get(`user.${userid}.subs.${channelToSub}`)) {
// If the user has 'subs' but not this particular subscription, add it // If the user has 'subs' but not this particular subscription, add it
db.set(`user.${userid}.subs.${channelToSub}`, { db.set(`user.${userid}.subs.${channelToSub}`, {
channelName: channelToSubName, channelName: channelToSubName,
avatar: avatar, // Store the avatar URL along with the subscription avatar: avatar, // Store the avatar URL along with the subscription
}); });
res.json("user subbed"); res.redirect("/account-create")
} else { } else {
// If the user is already subscribed to this channel, send a message indicating so // 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 // Check if userid is more than 6 characters
if (userid.length > 6) { 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`); var userSubs = db.get(`user.${userid}.subs`);