Skip to content

Commit

Permalink
[FEAT]#11 - mypage feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
yoon1013 committed Jun 12, 2022
1 parent c142926 commit ce54386
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1433,4 +1433,35 @@ app.post('/myUploadProject', async function(req,res){
"code": 201,
"projectInfoList": projectInfoList
});
});

//๋‚ด๊ฐ€ ์†ํ•œ ํ”„๋กœ์ ํŠธ์˜ ํ”ผ๋“œ
app.post('/myFeeds', async function(req,res){
var mNum = req.body.mNum;

var pNums = await ProjectInfo.findAll({
attributes: ['pNum'],
include: [{
model: Recruit,
where: {
mNum: mNum,
rApproval: 1
}
}],
where: {pState: 2}
});

var feeds = [];
for(var i = 0; i<pNums.length;i++){
var feed_project = await Feed.findOne({
attributes: ['fNum', 'fTitle', 'fTest'],
where: {pNum: pNums[i].pNum}
});
feeds[i] = feed_project;
}

res.json({
"code": 201,
"Feeds": feeds
});
});

0 comments on commit ce54386

Please sign in to comment.