Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added endpoint to get the roles of the user #37

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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