Reinstall dev env & Update the news page to include translating

functions & Update settings & sendUserChanges system. I also updated
*some* README stuff. & Update tos & privacy policy pages.
This commit is contained in:
yuanhau 2025-06-09 09:34:53 +08:00
parent 944caa03e8
commit 1e4e13f1b7
8 changed files with 184 additions and 263 deletions

View file

@ -1,7 +1,6 @@
import sql from "~/server/components/postgres";
export default defineEventHandler(async (event) => {
const body = await readBody(event);
/*
// Check user data.
const userToken = getCookie(event, "token");
if (!userToken) {
return {
@ -17,8 +16,18 @@ export default defineEventHandler(async (event) => {
error: "ERR_NOT_ALLOWED",
};
}
if (request_change === "groq_api_key") {
const updateListing = await sql``;
}*/
return { body: body };
// Actual function
const body = await readBody(event);
if (body.jsonValue.length === 0) {
const clearBadDataRegex = /[@-_.+a-zA-Z0-9]{2,}/;
let allowed = true;
if (body.value.match()) {
allowed = false;
}
return {
body: body,
allowed: allowed,
data: body.value.match(clearBadDataRegex),
};
}
});