Skip to content

Commit

Permalink
enhancement: update, save log 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
JeongSH1 committed Dec 8, 2023
1 parent 6b7ee67 commit c134bff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions db/save-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ export async function saveToken(userId, token) {

if (!token){
const [rows, fields] = await connection.execute('insert into tokens values(?, ?)', [userId, token]);
console.log(`${new Date()}: ${userId} save Token`)
return rows;
} else {
const [rows, fields] = await connection.execute('update tokens set token = ? where userId = ?', [token, userId]);
console.log(`${new Date()}: ${userId} update Token`)
return rows;
}

}

0 comments on commit c134bff

Please sign in to comment.