backend for xcvr appview
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

require uuid for image upload

+12 -1
+12 -1
server/internal/handler/lrcHandlers.go
··· 151 151 h.badRequest(w, errors.New("beep bop bad image: "+err.Error())) 152 152 return 153 153 } 154 + uuid := r.FormValue("uuid") 155 + if uuid == "" { 156 + h.badRequest(w, errors.New("uuid is required")) 157 + return 158 + } 154 159 file, fheader, err := r.FormFile("image") 155 160 if err != nil { 156 161 h.badRequest(w, errors.New("failed to formfile: "+err.Error())) ··· 172 177 } 173 178 w.Header().Set("Content-Type", "application/json") 174 179 encoder := json.NewEncoder(w) 175 - err = encoder.Encode(blob) 180 + response := struct { 181 + Blob interface{} `json:"blob"` 182 + UUID string `json:"uuid"` 183 + }{ 184 + Blob: blob, UUID: uuid, 185 + } 186 + err = encoder.Encode(response) 176 187 if err != nil { 177 188 h.badRequest(w, err) 178 189 return