feat: remove unnecessary DTO type
This commit is contained in:
parent
e7ba54a992
commit
47fa47bdc7
@ -118,17 +118,10 @@ func (rs *notesResource) Create(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Placeholder contents are decided server-side, so we need to inform the client of them via a
|
||||
// one-time-use DTO
|
||||
type response struct {
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
res := response{
|
||||
Title: initVersionTitle,
|
||||
Content: initVersionContent,
|
||||
}
|
||||
|
||||
respondJSON(w, http.StatusCreated, res)
|
||||
respondJSON(w, http.StatusCreated, map[string]string{
|
||||
"title": initVersionTitle,
|
||||
"content": initVersionContent,
|
||||
})
|
||||
}
|
||||
|
||||
// Handler for listing the metadata of all user's available notes. This metadata contains IDs of
|
||||
|
Loading…
x
Reference in New Issue
Block a user