Skip to content

Commit

Permalink
chore: token 재선언 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JeongSH1 committed Dec 8, 2023
1 parent c134bff commit dc7912c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/save-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { connection } from "./connection.js";
import { getTokenByUserId } from "./get-token.js";

export async function saveToken(userId, token) {
const token = await getTokenByUserId(userId);
const existToken = await getTokenByUserId(userId);

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

0 comments on commit dc7912c

Please sign in to comment.