GitHub user BenJanecke opened a pull request:
https://github.com/apache/couchdb-fauxton/pull/745
#3030 Centralise ajax requests
The api for the ajax module is as follows
```
import { get, post } from 'core/ajax';
// GET: /some_enpoint?page=1&order=name
get({
path: '/some_enpoint',
}, {
page: 1,
order: 'name',
}).then((response) => {
// do stuff
}, (err) => {
// something broke
});
// POST: /some_enpoint
body={ foo: 'bar' }
get({
path: '/some_enpoint',
data: { foo: 'bar' },
}).then((response) => {
// do stuff
}, (err) => {
// something broke
});
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/BenJanecke/couchdb-fauxton ajax
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fauxton/pull/745.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #745
----
commit a7419e4d404757c5b75a64c9b3fbd778b04f870b
Author: Ben Janecke <[email protected]>
Date: 2016-07-13T13:17:17Z
#3030 Centralise ajax requests
The api for the ajax module is as follows
```
import { get, post } from 'core/ajax';
// GET: /some_enpoint?page=1&order=name
get({
path: '/some_enpoint',
}, {
page: 1,
order: 'name',
}).then((response) => {
// do stuff
}, (err) => {
// something broke
});
// POST: /some_enpoint
body={ foo: 'bar' }
get({
path: '/some_enpoint',
data: { foo: 'bar' },
}).then((response) => {
// do stuff
}, (err) => {
// something broke
});
```
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---