You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backend/structures/Player.ts
+3-9Lines changed: 3 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -197,17 +197,11 @@ export default class Player {
197
197
if(!clan.joinable)thrownewError("This clan is not joinable");
198
198
if(parsedMembers.includes(targetPlayer))thrownewError("Requested user is already in this clan");
199
199
if(parsedMembers.length>=ClanController.MemberLimit)thrownewError("Clan is full");
200
-
if(((awaitbase.db.query(`SELECT "clan" FROM accounts WHERE "username" = $1`)).rows[0]||{}).clan)thrownewError("Requested user is already in another clan");
200
+
if(((awaitbase.db.query(`SELECT "clan" FROM accounts WHERE "username" = $1`,[targetPlayer])).rows[0]||{}).clan)thrownewError("Requested user is already in another clan");
201
201
202
202
parsedMembers.push(targetPlayer);
203
-
awaitbase.db.query(`
204
-
UPDATE accounts SET "clan" = $1 WHERE "username" = $2;
205
-
UPDATE clans SET "members" = $3 WHERE "name" = $1;
206
-
`,[
207
-
clan.name,
208
-
targetPlayer,
209
-
JSON.stringify(parsedMembers),
210
-
]);
203
+
awaitbase.db.query(`UPDATE accounts SET "clan" = $1 WHERE "username" = $2`,[clan.name,targetPlayer]);
204
+
awaitbase.db.query(`UPDATE clans SET "members" = $1 WHERE "name" = $2`,[JSON.stringify(parsedMembers),clan.name]);
0 commit comments