Import Steam friends into follows #897
Labels
For: Backend
This is something to do for the backend (server folder) of the website.
For: Frontend
This is something to do for the front end (client folder) of the website.
Priority: Low
Something not very essential to the release, can be done in free time and bumped back if needed.
Size: Medium
Something that may take a few days or so to implement.
Steam's API lets us fetch all of a user's Steam friends, so we can use that to automatically follow them.
Backend
Let's do a
GET /user/steamfriends
endpoint that uses theSteamService.getSteamFriends
method to fetch Steam friends, then query DB for the matching SteamIDs. Then return an array ofUserDto
for every found user. A regular array is probably better thanPagedResponseDto
since we want to avoid calling Steam's API too often, and users can have at most 500 Steam friends. The likelihood that someone has more than ~100 friends with Momentum is always going to be pretty low.Be sure to check out
LeaderboardRunsService.getRuns
to see an example of how to handle Steam friend data.Then we'll want an endpoint for bulk following users. This can be at
POST /user/follow
and take an array (just CSV in the URL) of Momentum User IDs.Frontend
Add a button with a Steam icon to the activity feed component that opens a new PrimeNG dialog component. It should contain a scrolling list of every user (
<a> containing their avatar and alias
) next to a checkbox, plus "Select All" and "Deselect All" buttons at the top right of the list. If >0 users are selected, enable a "Follow users" button that creates aPOST /user/follow
query on press, then closes the dialog.The text was updated successfully, but these errors were encountered: