mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-12 00:03:06 +00:00
mipilin r9... Fimally
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
961d963677
commit
fa8fae4638
9 changed files with 217 additions and 150 deletions
|
@ -149,7 +149,7 @@ export default async function (app: Express, db: NodePgDatabase) {
|
|||
(uname || "") !== req.session["user"] &&
|
||||
!(req.session["status"] & UserStatus.MODERATOR)
|
||||
) {
|
||||
res.redirect("back");
|
||||
res.redirect(req.get("Referrer") || "/");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -182,11 +182,7 @@ export default async function (app: Express, db: NodePgDatabase) {
|
|||
.where(eq(users.name, req.params.user))
|
||||
)[0];
|
||||
if (!uid) {
|
||||
req.flash(
|
||||
"error",
|
||||
"It looks like you're trying to follow a user that doesn't exist anymore."
|
||||
);
|
||||
res.redirect("/");
|
||||
render404(db, res, req);
|
||||
return;
|
||||
}
|
||||
const isFollowing = !!(
|
||||
|
@ -217,6 +213,6 @@ export default async function (app: Express, db: NodePgDatabase) {
|
|||
followerId: req.session["uid"]
|
||||
});
|
||||
}
|
||||
res.redirect(`/users/${req.params.user}`);
|
||||
res.redirect(req.get("Referrer") || "/");
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue