api: use commentoExportV1 struct

This commit is contained in:
Adhityaa Chandrasekar
2020-03-31 06:03:26 -04:00
parent 0d929595cc
commit 885b4c6689
3 changed files with 4 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import (
"net/http"
)
type dataImport struct {
type commentoExportV1 struct {
Version int `json:"version"`
Comments []comment `json:"comments"`
Commenters []commenter `json:"commenters"`
@@ -44,7 +44,7 @@ func domainImportCommento(domain string, url string) (int, error) {
return 0, errorInternal
}
var data dataImport
var data commentoExportV1
if err := json.Unmarshal(contents, &data); err != nil {
logger.Errorf("cannot unmarshal JSON at %s: %v", url, err)
return 0, errorInternal