weldr: use source.Id instead of .Name for keys
This commit is contained in:
parent
2ee12e2b51
commit
f0e2e3786f
1 changed files with 3 additions and 3 deletions
|
|
@ -133,7 +133,7 @@ func (api *API) sourceListHandler(writer http.ResponseWriter, request *http.Requ
|
|||
}
|
||||
|
||||
json.NewEncoder(writer).Encode(reply{
|
||||
Sources: []string{api.repo.Name},
|
||||
Sources: []string{api.repo.Id},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ func (api *API) sourceInfoHandler(writer http.ResponseWriter, request *http.Requ
|
|||
|
||||
// we only have one repository
|
||||
names := strings.Split(params.ByName("sources"), ",")
|
||||
if names[0] != api.repo.Name && names[0] != "*" {
|
||||
if names[0] != api.repo.Id && names[0] != "*" {
|
||||
statusResponseError(writer, http.StatusBadRequest, "repository not found: "+names[0])
|
||||
return
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@ func (api *API) sourceInfoHandler(writer http.ResponseWriter, request *http.Requ
|
|||
}
|
||||
|
||||
json.NewEncoder(writer).Encode(reply{
|
||||
Sources: map[string]sourceConfig{cfg.Name: cfg},
|
||||
Sources: map[string]sourceConfig{cfg.Id: cfg},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue