mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-22 23:31:01 +08: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
@ -141,7 +141,9 @@ const submitChangeAction = async (action: string) => {
|
||||
const response = await req.json();
|
||||
if (response.error) {
|
||||
console.error("Error updating user data:", response.error);
|
||||
return;
|
||||
}
|
||||
await validateUserInfo();
|
||||
} catch (error) {
|
||||
console.error("Failed to submit change:", error);
|
||||
}
|
||||
|
@ -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…
x
Reference in New Issue
Block a user