mirror of
https://github.com/coalaura/whiskr.git
synced 2025-09-08 17:06:42 +00:00
fix title schema
This commit is contained in:
8
title.go
8
title.go
@@ -17,7 +17,6 @@ type TitleRequest struct {
|
||||
|
||||
type TitleResponse struct {
|
||||
Title string `json:"title"`
|
||||
Cost float64 `json:"cost,omitempty"`
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -146,7 +145,8 @@ func HandleTitle(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
result.Cost = cost
|
||||
|
||||
RespondJson(w, http.StatusOK, result)
|
||||
RespondJson(w, http.StatusOK, map[string]any{
|
||||
"title": result.Title,
|
||||
"cost": cost,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user