mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-10 23:33:07 +00:00
joo can now delete mood updats
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
0ecc741a98
commit
8e3ae72ae7
9 changed files with 78 additions and 13 deletions
|
@ -136,9 +136,19 @@ export function journalMoodString(mood: number) {
|
|||
export function confirm(
|
||||
db: NodePgDatabase,
|
||||
res: Response,
|
||||
req: Request
|
||||
req: Request,
|
||||
defaultUrl = "/"
|
||||
) {
|
||||
render(db, "confirm", "Confirm action", res, req, { body: req.body, url: req.url });
|
||||
if (req.body.confirm === undefined) {
|
||||
req.session["back"] = req.get("Referrer") || defaultUrl;
|
||||
render(db, "confirm", "Confirm action", res, req, { body: req.body, url: req.url });
|
||||
} else if (req.body.confirm === "y") {
|
||||
return true;
|
||||
} else {
|
||||
//! dumb
|
||||
res.redirect(req.session["back"] || defaultUrl);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const emailRegex = /^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue