Skip to content

Commit

Permalink
website/api/v1: return an empty response if the query is empty
Browse files Browse the repository at this point in the history
instead of if the song result set is empty, this way we can display
a "no results found" instead.
  • Loading branch information
Wessie committed Jun 18, 2024
1 parent 3e9509a commit 1b53f73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion website/api/v1/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func (a *API) SearchHTML(w http.ResponseWriter, r *http.Request) {
return
}

if len(input.Songs) == 0 {
// return an empty response if the query is empty
if len(input.Query) == 0 {
w.WriteHeader(http.StatusOK)
return
}

Expand Down

0 comments on commit 1b53f73

Please sign in to comment.