1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-06-13 13:39:23 -04:00

Stop using form elements for API

Just send the JSON as the request body
This commit is contained in:
2017-11-13 20:48:19 -05:00
parent 9624f0c5bc
commit 5a6be5a07b
23 changed files with 87 additions and 159 deletions

View File

@ -101,7 +101,7 @@ function create(account) {
type: "POST",
dataType: "json",
url: "v1/accounts/",
data: {account: account.toJSON()},
data: account.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);
@ -128,7 +128,7 @@ function update(account) {
type: "PUT",
dataType: "json",
url: "v1/accounts/"+account.AccountId+"/",
data: {account: account.toJSON()},
data: account.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);

View File

@ -60,7 +60,7 @@ function importOFX(account, password, startDate, endDate) {
type: "POST",
dataType: "json",
url: "v1/accounts/"+account.AccountId+"/imports/ofx",
data: {ofxdownload: ofxdownload.toJSON()},
data: ofxdownload.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);

View File

@ -130,7 +130,7 @@ function create(report) {
type: "POST",
dataType: "json",
url: "v1/reports/",
data: {report: report.toJSON()},
data: report.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);
@ -157,7 +157,7 @@ function update(report) {
type: "PUT",
dataType: "json",
url: "v1/reports/"+report.ReportId+"/",
data: {report: report.toJSON()},
data: report.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);

View File

@ -101,7 +101,7 @@ function create(security) {
type: "POST",
dataType: "json",
url: "v1/securities/",
data: {security: security.toJSON()},
data: security.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);
@ -128,7 +128,7 @@ function update(security) {
type: "PUT",
dataType: "json",
url: "v1/securities/"+security.SecurityId+"/",
data: {security: security.toJSON()},
data: security.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);

View File

@ -139,7 +139,7 @@ function create(transaction) {
type: "POST",
dataType: "json",
url: "v1/transactions/",
data: {transaction: transaction.toJSON()},
data: transaction.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);
@ -166,7 +166,7 @@ function update(transaction) {
type: "PUT",
dataType: "json",
url: "v1/transactions/"+transaction.TransactionId+"/",
data: {transaction: transaction.toJSON()},
data: transaction.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);

View File

@ -116,7 +116,7 @@ function create(user) {
type: "POST",
dataType: "json",
url: "v1/users/",
data: {user: user.toJSON()},
data: user.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);
@ -143,7 +143,7 @@ function login(user) {
type: "POST",
dataType: "json",
url: "v1/sessions/",
data: {user: user.toJSON()},
data: user.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);
@ -220,7 +220,7 @@ function update(user) {
type: "PUT",
dataType: "json",
url: "v1/users/"+user.UserId+"/",
data: {user: user.toJSON()},
data: user.toJSON(),
success: function(data, status, jqXHR) {
var e = new Error();
e.fromJSON(data);