weldr: Update the sourceNewHandler to use the correct struct

The store supports different fields than the API, this switches to using
an API specific struct with support for proxy and gpgkey_files.
This commit is contained in:
Brian C. Lane 2020-03-19 10:13:17 -07:00 committed by Tom Gundersen
parent 01aca4ecf7
commit 6e40729cd3

View file

@ -354,7 +354,7 @@ func (api *API) sourceNewHandler(writer http.ResponseWriter, request *http.Reque
return
}
var source store.SourceConfig
var source SourceConfigV0
var err error
if contentType[0] == "application/json" {
err = json.NewDecoder(request.Body).Decode(&source)
@ -374,7 +374,7 @@ func (api *API) sourceNewHandler(writer http.ResponseWriter, request *http.Reque
return
}
api.store.PushSource(source)
api.store.PushSource(source.SourceConfig())
statusResponseOK(writer)
}