Existing proposals in data.
All checks were successful
continuous-integration/drone Build is passing

* Data contains existing proposals too.

#2
This commit is contained in:
zegkljan 2023-08-03 22:46:20 +02:00
parent 8440e3b7d7
commit 8e713ae8da
2 changed files with 8 additions and 2 deletions

View File

@ -91,6 +91,7 @@ type HandshakeResponse struct {
type Data struct { type Data struct {
Users []User `json:"users"` Users []User `json:"users"`
Features []Feature `json:"features"` Features []Feature `json:"features"`
Proposals []Proposal `json:"proposals"`
PhotoMetadata map[string]PhotoMetadata `json:"photo_metadata,omitempty"` PhotoMetadata map[string]PhotoMetadata `json:"photo_metadata,omitempty"`
} }

View File

@ -293,10 +293,15 @@ func (s *Server) getData(conn *sqlite.Conn) (data models.Data, err error) {
if err != nil { if err != nil {
return models.Data{}, fmt.Errorf("failed to retreive features: %w", err) return models.Data{}, fmt.Errorf("failed to retreive features: %w", err)
} }
proposals, err := s.getProposals(conn)
if err != nil {
return models.Data{}, fmt.Errorf("failed to retrieve proposals: %w", err)
}
return models.Data{ return models.Data{
Users: people, Users: people,
Features: features, Features: features,
Proposals: proposals,
}, nil }, nil
} }