Skip to content

Commit

Permalink
Merge pull request #37 from Vishal968/VP_0907
Browse files Browse the repository at this point in the history
Added endpoint to get the roles of the user
  • Loading branch information
adityabaravkar authored Sep 11, 2023
2 parents 4ed887a + f670ceb commit f48d062
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion myspace_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# MANIFEST MY SPACE (PROPERTY MANAGEMENT) BACKEND PYTHON FILE
# https://l0h6a9zi1e.execute-api.us-west-1.amazonaws.com/dev/<enter_endpoint_details>
from announcements import Announcements
from announcements import Announcements,AnnouncementsByUid
from profiles import RolesByUserid
# To run program: python3 myspace_api.py

# README: if conn error make sure password is set properly in RDS PASSWORD section
Expand Down Expand Up @@ -442,6 +443,8 @@ def get(self, tenant_id):
api.add_resource(ContactsBusinessContactsMaintenanceDetails, '/contactsBusinessContactsMaintenanceDetails/<string:business_uid>')

api.add_resource(Announcements, '/announcements')
api.add_resource(AnnouncementsByUid, '/announcements/<string:announcement_uid>')
api.add_resource(RolesByUserid, '/rolesByUserId/<string:user_id>')

api.add_resource(List, '/lists')

Expand Down
8 changes: 8 additions & 0 deletions profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ def get(self, tenant_id):
return response


class RolesByUserid(Resource):
def get(self, user_id):
print('in RolesByUserid')
with connect() as db:
response = db.select('user_profiles', {"user_id": user_id})
return response


class BusinessProfile(Resource):
def post(self):
print('in BusinessProfile')
Expand Down

0 comments on commit f48d062

Please sign in to comment.