Skip to content

Commit

Permalink
Merge pull request #791 from NASA-IMPACT/85-pattern-error
Browse files Browse the repository at this point in the history
85 pattern error
  • Loading branch information
Jmok19927 authored May 31, 2024
2 parents 8070002 + 70ff0e5 commit c5d9585
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sde_indexing_helper/static/js/candidate_url_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,10 @@ function postDocumentTypePatterns(
},
error: function (xhr, status, error) {
var errorMessage = xhr.responseText;
if (errorMessage == '{"error":{"non_field_errors":["The fields collection, match_pattern must make a unique set."]},"status_code":400}') {
toastr.success("Pattern already exists");
return;
}
toastr.error(errorMessage);
},
});
Expand Down Expand Up @@ -974,6 +978,10 @@ function postTitlePatterns(
},
error: function (xhr, status, error) {
var errorMessage = xhr.responseText;
if (errorMessage == '{"error":{"non_field_errors":["The fields collection, match_pattern must make a unique set."]},"status_code":400}') {
toastr.success("Pattern already exists");
return;
}
toastr.error(errorMessage);
},
});
Expand Down

0 comments on commit c5d9585

Please sign in to comment.