Commit 58873aad authored by soheib's avatar soheib
Browse files

add return lottry chancess in weekly search response

parent dbfe9be0
......@@ -47,13 +47,19 @@ export class LotteryService {
postArray,
)
const addToStoryScore = await this.scoreService.getTagsScore(username)
let foundIndexes = await this.lotteryResultModel.find({user_id: foundUser._id})
let chances = new Array<string>()
foundIndexes.forEach(result=>{
chances.push(result.index)
})
return {
likesScore,
commentScore,
addToStoryScore,
totalScore: likesScore + commentScore + addToStoryScore,
lottry_chances : chances
}
}
async addResultsToDB(profileUsername: string, postArray: string[]) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment