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
|
// Placeholder contents are decided server-side, so we need to inform the client of them via a
|
||||||
// one-time-use DTO
|
// one-time-use DTO
|
||||||
type response struct {
|
respondJSON(w, http.StatusCreated, map[string]string{
|
||||||
Title string `json:"title"`
|
"title": initVersionTitle,
|
||||||
Content string `json:"content"`
|
"content": initVersionContent,
|
||||||
}
|
})
|
||||||
|
|
||||||
res := response{
|
|
||||||
Title: initVersionTitle,
|
|
||||||
Content: initVersionContent,
|
|
||||||
}
|
|
||||||
|
|
||||||
respondJSON(w, http.StatusCreated, res)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handler for listing the metadata of all user's available notes. This metadata contains IDs of
|
// 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