Skip to content

Commit

Permalink
ch: enable follow activity logging
Browse files Browse the repository at this point in the history
  • Loading branch information
khalifan-kfan committed Jul 9, 2024
1 parent 463e0c7 commit 471480a
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 103 deletions.
10 changes: 8 additions & 2 deletions app/controllers/activity_feed.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from app.models.app import App
from app.schemas.app import AppSchema
from app.schemas.project import ProjectSchema
from app.schemas.user import UserSchema
from flask import current_app
from flask_restful import Resource, request
from app.models.user import User
Expand All @@ -16,12 +17,13 @@ def get(self):
current_user = User.get_by_id(current_user_id)
project_schema = ProjectSchema()
app_schema = AppSchema()
user_schema = UserSchema()

params = {
'general': True,
'operations': ['Create', 'Update', 'Delete'],
'operations': ['Create', 'Update', 'Delete', 'Follow'],
'statuses': ['Success'],
'models': ['Project', 'App', 'Database', ]
'models': ['Project', 'App', 'Database', 'User' ]
}
user_id = request.args.get('user_id', None)
if user_id:
Expand Down Expand Up @@ -60,6 +62,10 @@ def get(self):
app = App.get_by_id(item['a_app_id'])
app_data, _ = app_schema.dump(app)
item['app'] = app_schema.dump(app_data)[0]
if item['model'] == 'User' and item['a_user_id'] != None:
user = User.get_by_id(item['a_user_id'])
user_data, _ = user_schema.dump(user)
item['a_user'] = user_schema.dump(user_data)[0]
elif item['model'] == 'Database':
pass
user_feed['data']['activity'] = user_activities
Expand Down
Loading

0 comments on commit 471480a

Please sign in to comment.