Skip to content

Commit

Permalink
Fix: match api 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sw0501 committed Nov 28, 2023
1 parent 1bf9662 commit b6c20c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ router.get('/match/:id',async(req,res)=>{

const connection = await db.return_connection();

let SQL = "select match_id, ifnull(loser,challenger) as loser, ifnull(winner,contender) as winner, losescore, winscore, challenger, contender, applymessage, creationDate from matches ";
SQL += "left join challenge on match_id = challenge_id";
let SQL = "select match_id, ifnull(loser,challenger) as loser, ifnull(winner,contender) as winner, losescore, winscore, challenger, contender, applymessage, creationDate from matches ";
SQL += "left join challenge on match_id = challenge_id ";
SQL += "where contender = (select name from userinfo where id = ?) or challenger = (select name from userinfo where id = ?) order by matchDate desc;";

connection.query(SQL, [user_id, user_id], function(err,results,field){
Expand Down

0 comments on commit b6c20c5

Please sign in to comment.