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

Create API view to fetch other user's completed challenges #118

Open
HuxleyBerry opened this issue Jan 17, 2025 · 1 comment
Open

Create API view to fetch other user's completed challenges #118

HuxleyBerry opened this issue Jan 17, 2025 · 1 comment
Assignees
Labels
backend Task must have a back end issue difficulty::hard This issue is hard priority::high This issue is high priority

Comments

@HuxleyBerry
Copy link
Member

HuxleyBerry commented Jan 17, 2025

The view should take the username of a user as input and do the following things:

  • Return the users first name, last name, avatar, bio, and number of points
  • Calculate whether the logged in user (call them Y) has permission to view the completed challenges of this user (call them X)
    • If X has their visibility set to "BlueCrew Only", then Y can view X's completed challenges if and only if Y is staff
    • If X has their visibility set to "Friends Only", then Y can view X's completed challenges if and only if Y is staff or X is friends with Y
    • If X has their visibility set to "Public", then Y can always view X's completed challenge
  • If Y does indeed have permission to view X's completed challenges, then for each challenge completed by X (i.e. each instance of the TileInteraction model which is linked to X), the following information should be returned:
    • The name of the challenge
    • The description of the challenge
    • The type of the challenge (connect/understand/act)
    • How many points the challenge was worth
    • The image X uploaded for the challenge
    • The date X started the challenge
    • The date X finished the challenge

The trickiest thing here is probably sending the image files to the frontend. I'm not sure of the details, but it could end up being hard to send multiple images together with json data. If so, an alternate option is for this view to not return the images, and instead have a separate view which would return a single image which would be called when the user clicks a button.

@HuxleyBerry HuxleyBerry added backend Task must have a back end issue difficulty::hard This issue is hard priority::high This issue is high priority labels Jan 17, 2025
@23348918 23348918 self-assigned this Jan 18, 2025
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Task must have a back end issue difficulty::hard This issue is hard priority::high This issue is high priority
Projects
None yet
Development

No branches or pull requests

2 participants