mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-31 11:56:27 +03:00
formatting
This commit is contained in:
committed by
GitHub
parent
544af7ce15
commit
0f4b0c2f54
@@ -70,8 +70,11 @@ export async function setUsername(req: Request, res: Response): Promise<Response
|
|||||||
if (row?.userName !== undefined) {
|
if (row?.userName !== undefined) {
|
||||||
//already exists, update this row
|
//already exists, update this row
|
||||||
oldUserName = row.userName;
|
oldUserName = row.userName;
|
||||||
if (userName == userID && !locked) await db.prepare("run", `DELETE FROM "userNames" WHERE "userID" = ?`, [userID]);
|
if (userName == userID && !locked) {
|
||||||
else await db.prepare("run", `UPDATE "userNames" SET "userName" = ?, "locked" = ? WHERE "userID" = ?`, [userName, locked, userID]);
|
await db.prepare("run", `DELETE FROM "userNames" WHERE "userID" = ?`, [userID]);
|
||||||
|
} else {
|
||||||
|
await db.prepare("run", `UPDATE "userNames" SET "userName" = ?, "locked" = ? WHERE "userID" = ?`, [userName, locked, userID]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//add to the db
|
//add to the db
|
||||||
await db.prepare("run", `INSERT INTO "userNames"("userID", "userName", "locked") VALUES(?, ?, ?)`, [userID, userName, locked]);
|
await db.prepare("run", `INSERT INTO "userNames"("userID", "userName", "locked") VALUES(?, ?, ?)`, [userID, userName, locked]);
|
||||||
|
|||||||
Reference in New Issue
Block a user