GoScrobble/internal/goscrobble/profile.go
Daniel Mason e570314ac2
0.0.9
- Fix mobile menu auto collapse on select
- Add /u/ route for public user profiles (Added private flag to db - to implement later)
- Add /user route for your own profile / edit profile
- Added handling for if API is offline/incorrect
- Add index.html loading spinner while react bundle downloads
- Change HashRouter to BrowserRouter
- Added sources column to scrobbles
2021-04-01 23:17:46 +13:00

22 lines
493 B
Go

package goscrobble
type ProfileResponse struct {
UUID string `json:"uuid"`
Username string `json:"username"`
Scrobbles []ScrobbleRequestItem `json:"scrobbles"`
}
func getProfile(user User) (ProfileResponse, error) {
resp := ProfileResponse{
UUID: user.UUID,
Username: user.Username,
}
scrobbleReq, err := fetchScrobblesForUser(user.UUID, 10, 1)
if err != nil {
return resp, err
}
resp.Scrobbles = scrobbleReq.Items
return resp, nil
}