mirror of
https://github.com/okiba-org/backend.git
synced 2025-07-02 12:58:22 +00:00
refactor: fix missing await and bad practices
This commit is contained in:
@ -8,12 +8,7 @@ export const getAvailableWord = async (db: Pool): Promise<Word | undefined> => {
|
||||
.query(Query.getAvailableWord)
|
||||
.catch((err) => err);
|
||||
|
||||
if (data != undefined) {
|
||||
let word = data.rows[0];
|
||||
return word;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return data?.rows[0];
|
||||
};
|
||||
|
||||
export const setWordTaken = async (db: Pool, id: number) => {
|
||||
|
Reference in New Issue
Block a user