This commit is contained in:
Daniel Ledda
2020-11-04 18:58:33 +01:00
parent e16700d1de
commit 42d372c860

View File

@@ -7,6 +7,10 @@ import (
"io/ioutil"
)
type SnapshotListResponse struct {
Snapshots []*SnapshotRecord `json:"snapshots"`
}
type SnapshotRecord struct {
Id int `json:"id"`
SnapshotSubmission
@@ -37,7 +41,7 @@ func createSnapshotSubFromJsonBodyStream(jsonBodyStream io.ReadCloser) (*Snapsho
}
func createJsonFromSnapshotRecords(records []*SnapshotRecord) ([]byte, error) {
jsonResult, err := json.Marshal(records)
jsonResult, err := json.Marshal(SnapshotListResponse{records})
if err != nil {
return nil, err
}