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:
10
title.go
10
title.go
@@ -16,8 +16,7 @@ type TitleRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TitleResponse struct {
|
type TitleResponse struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Cost float64 `json:"cost,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -146,7 +145,8 @@ func HandleTitle(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Cost = cost
|
RespondJson(w, http.StatusOK, map[string]any{
|
||||||
|
"title": result.Title,
|
||||||
RespondJson(w, http.StatusOK, result)
|
"cost": cost,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user