mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
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:
parent
944caa03e8
commit
1e4e13f1b7
8 changed files with 184 additions and 263 deletions
|
@ -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),
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue