register flags
This commit is contained in:
1 parent
46ed3a1f41
commit
af76e8f2f9
6 files changed
+49
-343
No files matched your search
@@ -16,6 +16,12 @@ export async function getFieldId(field: string): Promise<number> {
|
||||
return await execQueryAsyncWithId(query, values);
|
||||
}
|
||||
|
||||
export async function getFlagId(flag: string): Promise<number> {
|
||||
const query = `INSERT INTO flag_name (flag_name) VALUES (?) ON DUPLICATE KEY UPDATE flag_id=LAST_INSERT_ID(flag_id)`;
|
||||
const values = [flag];
|
||||
return await execQueryAsyncWithId(query, values);
|
||||
}
|
||||
|
||||
export async function findRoomByOwner(ownerId: number): Promise<{ room_id: number }[]> {
|
||||
const query = `SELECT room_id FROM app_room WHERE owner_id = ?`;
|
||||
const values = [ownerId];
|
||||
|
||||
Reference in new issue
Block a user