mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
formatting
This commit is contained in:
parent
544af7ce15
commit
0f4b0c2f54
1 changed files with 5 additions and 2 deletions
|
@ -70,8 +70,11 @@ export async function setUsername(req: Request, res: Response): Promise<Response
|
|||
if (row?.userName !== undefined) {
|
||||
//already exists, update this row
|
||||
oldUserName = row.userName;
|
||||
if (userName == userID && !locked) 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]);
|
||||
if (userName == userID && !locked) {
|
||||
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 {
|
||||
//add to the db
|
||||
await db.prepare("run", `INSERT INTO "userNames"("userID", "userName", "locked") VALUES(?, ?, ?)`, [userID, userName, locked]);
|
||||
|
|
Loading…
Reference in a new issue