diff --git a/myspace_api.py b/myspace_api.py index d140cd6..20438f8 100644 --- a/myspace_api.py +++ b/myspace_api.py @@ -1,6 +1,7 @@ # MANIFEST MY SPACE (PROPERTY MANAGEMENT) BACKEND PYTHON FILE # https://l0h6a9zi1e.execute-api.us-west-1.amazonaws.com/dev/ -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 @@ -442,6 +443,8 @@ def get(self, tenant_id): api.add_resource(ContactsBusinessContactsMaintenanceDetails, '/contactsBusinessContactsMaintenanceDetails/') api.add_resource(Announcements, '/announcements') +api.add_resource(AnnouncementsByUid, '/announcements/') +api.add_resource(RolesByUserid, '/rolesByUserId/') api.add_resource(List, '/lists') diff --git a/profiles.py b/profiles.py index 9a753d6..bbb08f0 100644 --- a/profiles.py +++ b/profiles.py @@ -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')