Commit ec32c735 authored by soheib's avatar soheib
Browse files

add is follower status to get likes, comments and add story mention data

parent 4ea17049
......@@ -139,7 +139,9 @@ export class InstagramService implements OnApplicationBootstrap {
}
else {
let newUser = await this.userModel.create({
_id: new Types.ObjectId()
_id: new Types.ObjectId(),
username: userData.username,
is_follower: false
})
await this.storyMentionModel.create({
_id: new Types.ObjectId(),
......
......@@ -77,7 +77,7 @@ def getComments(db, post, profile):
user_id = found_username['_id']
else:
created_user = account_col.insert_one({"username": comment.owner.username,
"instagram_user_id": comment.owner.userid})
"instagram_user_id": comment.owner.userid, "is_follower": false})
user_id = created_user.inserted_id
print(comment.owner.username, 'added to users')
......
......@@ -80,7 +80,7 @@ def getLikes(db, post, profile):
user_id = found_username['_id']
else:
created_user = account_col.insert_one(
{"username": like.username})
{"username": like.username, "is_follower": false})
user_id = created_user.inserted_id
print(like.username, 'added to users')
temp = {"user_id": user_id,
......
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