Skip to content

Commit

Permalink
rename dataTypes key name
Browse files Browse the repository at this point in the history
  • Loading branch information
noctillion committed Oct 10, 2023
1 parent ff561ed commit 2767c32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/api/mvc/variants/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,22 +639,22 @@ type DataTypeSummary struct {
Queryable bool `json:"queryable"`
Schema map[string]interface{} `json:"schema"`
Count int `json:"count"`
LastCreated string `json:"last_created"`
LastCreated string `json:"last_ingested"`
}

type DataTypeResponseDto = []DataTypeSummary

func GetDatasetDataTypes(c echo.Context) error {
count := GetDatasetVariantsCount(c)
last_created := GetLastCreatedVariantForDataset(c)
last_ingested := GetLastCreatedVariantForDataset(c)
return c.JSON(http.StatusOK, &DataTypeResponseDto{
DataTypeSummary{
Id: "variant",
Label: "Variants",
Queryable: true,
Schema: schemas.VARIANT_SCHEMA,
Count: count,
LastCreated: last_created,
LastCreated: last_ingested,
},
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/services/variants/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func GetVariantsOverview(es *elasticsearch.Client, cfg *models.Config) (map[stri
}

// Extract latest created time
if latest, exists := resultsMap["last_created"].(map[string]interface{}); exists {
if latest, exists := resultsMap["last_ingested"].(map[string]interface{}); exists {
latestCreatedTime := latest["value_as_string"].(string)
resultsMap["last_created_time"] = latestCreatedTime
}
Expand Down

0 comments on commit 2767c32

Please sign in to comment.