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:
parent
81fcf0f5df
commit
7e7f63e6f4
15 changed files with 157 additions and 149 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue