mirror of
https://github.com/Cernobor/oko-server.git
synced 2025-02-24 08:27:17 +00:00
* Data contains existing proposals too. #2
This commit is contained in:
@@ -91,6 +91,7 @@ type HandshakeResponse struct {
|
||||
type Data struct {
|
||||
Users []User `json:"users"`
|
||||
Features []Feature `json:"features"`
|
||||
Proposals []Proposal `json:"proposals"`
|
||||
PhotoMetadata map[string]PhotoMetadata `json:"photo_metadata,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -293,10 +293,15 @@ func (s *Server) getData(conn *sqlite.Conn) (data models.Data, err error) {
|
||||
if err != nil {
|
||||
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{
|
||||
Users: people,
|
||||
Features: features,
|
||||
Proposals: proposals,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user