mirror of
https://github.com/csd4ni3l/grass_touching_captcha.git
synced 2026-01-01 04:23:45 +01:00
show error messages instead of Unknown Error, add an Images table so now the same images cant be uploaded multiple times
This commit is contained in:
@@ -59,7 +59,7 @@ function upload_file(file_type, file_content) {
|
||||
}
|
||||
}
|
||||
).then(response => {
|
||||
if (response.status == 401) {
|
||||
if (response.status == 401 || response.status == 400) {
|
||||
response.text().then(text => {
|
||||
if (text) {
|
||||
upload_error(text);
|
||||
@@ -69,10 +69,6 @@ function upload_file(file_type, file_content) {
|
||||
)
|
||||
return;
|
||||
}
|
||||
else if (response.status == 400) {
|
||||
upload_error("Unknown error");
|
||||
return;
|
||||
}
|
||||
|
||||
return response.text();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user