Skip to content

Commit 3a28cae

Browse files
author
Emmanouil Konstantinidis
committed
Handle method OPTIONS
1 parent abaf20c commit 3a28cae

File tree

1 file changed

+10
-2
lines changed
  • rest_framework_docs/static/rest_framework_docs/js

1 file changed

+10
-2
lines changed

rest_framework_docs/static/rest_framework_docs/js/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ var jsonPP = {
2222

2323
$( document ).ready(function() {
2424

25-
var setResponse = function (response) {
25+
var setResponse = function (method, response) {
26+
27+
console.log(response);
28+
console.log(response.status);
29+
30+
if (method == 'OPTIONS') {
31+
$('#responseData').html(jsonPP.prettyPrint(response));
32+
return;
33+
}
2634

2735
// Status Code
2836
var statusCodeFirstChar = String(response.status).charAt(0);
@@ -69,7 +77,7 @@ $( document ).ready(function() {
6977
password: 'test'
7078
}
7179
}).always(function(response) {
72-
setResponse(response);
80+
setResponse(method, response);
7381
});
7482
};
7583

0 commit comments

Comments
 (0)