enbas/internal/client/preferences.go
Dan Anglin 3d20adfa57
chore: REUSE.toml
- Replace .reuse/dep5 with the new REUSE.toml file.
- Add licensing information to REUSE.toml and remove the licensing
  headers from the source files.
2024-08-01 04:01:38 +01:00

20 lines
487 B
Go

package client
import (
"fmt"
"net/http"
"codeflow.dananglin.me.uk/apollo/enbas/internal/model"
)
func (g *Client) GetUserPreferences() (*model.Preferences, error) {
url := g.Authentication.Instance + "/api/v1/preferences"
var preferences model.Preferences
if err := g.sendRequest(http.MethodGet, url, nil, &preferences); err != nil {
return nil, fmt.Errorf("received an error after sending the request to get the user preferences: %w", err)
}
return &preferences, nil
}