mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(onboarding): could not create user (#848)
fix: onboarding not working
This commit is contained in:
parent
d03561d61c
commit
7f05dd1efd
16 changed files with 182 additions and 130 deletions
|
@ -48,11 +48,11 @@ func (h feedHandler) find(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
feeds, err := h.service.Find(ctx)
|
||||
if err != nil {
|
||||
h.encoder.StatusNotFound(ctx, w)
|
||||
h.encoder.StatusNotFound(w)
|
||||
return
|
||||
}
|
||||
|
||||
h.encoder.StatusResponse(ctx, w, feeds, http.StatusOK)
|
||||
h.encoder.StatusResponse(w, http.StatusOK, feeds)
|
||||
}
|
||||
|
||||
func (h feedHandler) store(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -63,7 +63,7 @@ func (h feedHandler) store(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
if err := json.NewDecoder(r.Body).Decode(&data); err != nil {
|
||||
// encode error
|
||||
h.encoder.StatusNotFound(ctx, w)
|
||||
h.encoder.StatusNotFound(w)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ func (h feedHandler) store(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
h.encoder.StatusResponse(ctx, w, data, http.StatusCreated)
|
||||
h.encoder.StatusResponse(w, http.StatusCreated, data)
|
||||
}
|
||||
|
||||
func (h feedHandler) test(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -117,7 +117,7 @@ func (h feedHandler) update(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
h.encoder.StatusResponse(ctx, w, data, http.StatusCreated)
|
||||
h.encoder.StatusResponse(w, http.StatusCreated, data)
|
||||
}
|
||||
|
||||
func (h feedHandler) toggleEnabled(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -144,7 +144,7 @@ func (h feedHandler) toggleEnabled(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
h.encoder.StatusResponse(ctx, w, nil, http.StatusNoContent)
|
||||
h.encoder.StatusResponse(w, http.StatusNoContent, nil)
|
||||
}
|
||||
|
||||
func (h feedHandler) delete(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -160,7 +160,7 @@ func (h feedHandler) delete(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
h.encoder.StatusResponse(ctx, w, nil, http.StatusNoContent)
|
||||
h.encoder.StatusResponse(w, http.StatusNoContent, nil)
|
||||
}
|
||||
|
||||
func (h feedHandler) latestRun(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -182,7 +182,7 @@ func (h feedHandler) latestRun(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if feed == "" {
|
||||
h.encoder.StatusNotFound(ctx, w)
|
||||
h.encoder.StatusNotFound(w)
|
||||
w.Write([]byte("No data found"))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue