Commit 84edd8b7 authored by Frank Bergmann's avatar Frank Bergmann

- Fixed JSON return messages

parent 52f5b69a
Pipeline #619 failed with stages
......@@ -15,7 +15,7 @@ if {[info exists upload_file]} {
if {"" == $title} { set title $upload_file }
} else {
ns_log Notice "file-add: failure: upload_file does not exist"
ns_return 200 "text/html" "{
ns_return 400 "application/json" "{
\"result\": {
\"success\": false,
\"errors\": {\"upload_file\": \"You have to specify a file to upload\"}
......@@ -44,7 +44,7 @@ ns_log Notice "file-add: permission_p=$permission_p"
if {1 != $permission_p} {
ns_log Notice "file-add: failure: User \#$user_id doesn't have write permissions to folder \#$folder_id"
doc_return 200 "text/html" "{
doc_return 400 "application/json" "{
\"result\": {
\"success\": false,
\"errors\": {\"permission\": \"You do not have permission to write to folder \#$folder_id\"}
......@@ -76,7 +76,7 @@ if {"" != $upload_file} {
set folder_path [db_string folder_path "select fs_folder_path from im_biz_objects where object_id = :ticket_id"]
ns_log Notice "file-add: success"
doc_return 200 "text/html" "{
doc_return 200 "application/json" "{
\"result\": {
\"success\": true,
\"message\": \"File successfully created\",
......
......@@ -25,10 +25,9 @@ db_release_unused_handles
ad_http_cache_control
ns_log Notice "file-delete: success"
ns_return 200 "text/html" "{
ns_return 200 "application/json" "{
\"result\": {
\"success\": true,
\"errors\": {\"email\": \"already taken\"}
\"success\": true
}
}"
ad_script_abort
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment