1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

refactored base-editor-inline to support section and block editing

This commit is contained in:
Harvey Kandola 2017-03-05 19:11:01 +00:00
parent 81fcf0f5df
commit 7e7f63e6f4
15 changed files with 157 additions and 149 deletions

View file

@ -320,9 +320,15 @@ func UpdateBlock(w http.ResponseWriter, r *http.Request) {
method := "UpdateBlock"
p := request.GetPersister(r)
params := mux.Vars(r)
blockID := params["blockID"]
if len(blockID) == 0 {
writeMissingDataError(w, method, "blockID")
return
}
defer utility.Close(r.Body)
body, err := ioutil.ReadAll(r.Body)
if err != nil {
writeBadRequestError(w, method, "Bad payload")
return
@ -335,6 +341,8 @@ func UpdateBlock(w http.ResponseWriter, r *http.Request) {
return
}
b.RefID = blockID
if !p.CanUploadDocument(b.LabelID) {
writeForbiddenError(w)
return