Skip to content

Update specs #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions js/specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ function defineSpecsFor(apiRoot){
return ajax("GET", url, options);
}
function post(url, data, options){
options = options || {};
options = options || {
contentType: "application/json"
};
options.data = JSON.stringify(data);
return ajax("POST", url, options);
}
Expand All @@ -17,7 +19,9 @@ function defineSpecsFor(apiRoot){
}

function patch(url, data, options){
options = options || {};
options = options || {
contentType: "application/json"
};
options.data = JSON.stringify(data);
return ajax("PATCH", url, options);
}
Expand Down Expand Up @@ -260,7 +264,6 @@ function defineSpecsFor(apiRoot){
var ajaxOptions = _.defaults( (options||{}), {
type: httpMethod,
url: url,
contentType: "application/json",
dataType: "text", // so we can explicitly parse JSON and fail with more detail than jQuery usually would give us
timeout: 30000 // so that we don't fail while waiting on a heroku dyno to spin up
});
Expand Down