armadillo.File.prototype.remove = function() {
var file = this;
var callback = function(data, status, xhr) {
- if (data['error']) {
- app.showError(data['message']);
- return;
- } else {
- app.clearError();
- }
+ app.clearError();
app.list(file.path_);
};
app.sendRequest('remove', {'path':this.path_ + this.name_}, callback);
io.Copy(rw, fd)
}
+type pathReseponse struct {
+ Path string `json:"path"`
+}
+
func listService(rw http.ResponseWriter, req *http.Request) {
if !requestIsPOST(rw, req) {
return
if err != nil {
httpError(rw, err.Error(), http.StatusNotFound)
} else {
- data := map[string]int{
- "error": 0,
- }
- okResponse(rw, data)
+ okResponse(rw, nil)
}
}
if err != nil {
httpError(rw, err.Error(), http.StatusNotFound)
} else {
- data := map[string]interface{}{
- "path": target,
- "error": 0,
- }
- okResponse(rw, data)
+ okResponse(rw, pathReseponse{target})
}
}
if err != nil {
httpError(rw, err.Error(), http.StatusUnauthorized)
} else {
- data := map[string]interface{}{
- "path": path,
- "error": 0,
- }
- okResponse(rw, data)
+ okResponse(rw, pathReseponse{path})
}
}
if err != nil {
httpError(rw, err.Error(), http.StatusBadRequest)
} else {
- data := map[string]interface{}{
- "path": newPath,
- "error": 0,
- }
- okResponse(rw, data)
+ okResponse(rw, pathReseponse{newPath})
}
}