mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Fix the var that is causing platforms to not send correctly & fix
check user info everytime after you file for a change.
This commit is contained in:
parent
f1324ae0e4
commit
68d1c8f018
2 changed files with 4 additions and 2 deletions
|
@ -13,7 +13,7 @@ export default defineEventHandler(async (event) => {
|
|||
if (body.jsonValue.length === 0) {
|
||||
const clearBadDataRegex = /[@-_.+a-zA-Z0-9]{2,}/;
|
||||
// Use Static values for now.
|
||||
const requestChange = body.action;
|
||||
const requestChange = body.action || "";
|
||||
const apiKeyqq = body.value.match(clearBadDataRegex);
|
||||
const allowedColumns = ["firstname", "email"];
|
||||
|
||||
|
@ -21,7 +21,7 @@ export default defineEventHandler(async (event) => {
|
|||
return {
|
||||
error: "ERR_NOT_ALLOWED",
|
||||
};
|
||||
} else if (requestChange === "name") {
|
||||
} else if (requestChange === "firstname") {
|
||||
const sqlC = await sql`
|
||||
UPDATE users SET firstname = ${apiKeyqq[0]}
|
||||
WHERE username = ${token.user}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue