Data -> Payload & change order.

This commit is contained in:
Miroslav Šedivý 2020-11-18 21:56:42 +01:00
parent ac2fc100b4
commit 18ca647c76
3 changed files with 21 additions and 21 deletions

View file

@ -6,7 +6,7 @@ import (
"demodesk/neko/internal/utils"
)
type ClipboardData struct {
type ClipboardPayload struct {
Text string `json:"text"`
}
@ -14,13 +14,13 @@ func (h *RoomHandler) ClipboardRead(w http.ResponseWriter, r *http.Request) {
// TODO: error check?
text := h.desktop.ReadClipboard()
utils.HttpSuccess(w, ClipboardData{
utils.HttpSuccess(w, ClipboardPayload{
Text: text,
})
}
func (h *RoomHandler) ClipboardWrite(w http.ResponseWriter, r *http.Request) {
data := &ClipboardData{}
data := &ClipboardPayload{}
if !utils.HttpJsonRequest(w, r, data) {
return
}