Skip to content

Commit

Permalink
Use post search requests
Browse files Browse the repository at this point in the history
  • Loading branch information
versx committed Aug 17, 2020
1 parent 44bb572 commit bc19e46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ router.post('/get_data', async (req, res) => {
res.json({ data: data });
});

router.get('/search', async (req, res) => {
const data = await getSearch(req.query);
router.post('/search', async (req, res) => {
const data = await getSearch(req.body);
res.json({ data: data });
});

Expand Down
7 changes: 4 additions & 3 deletions src/views/index-js.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -1791,12 +1791,13 @@ function loadSearchData (id, value) {
}
$.ajax({
url: '/api/search',
type: 'GET',
type: 'POST',
data: {
id: id,
value: value,
lat: center.lat,
lon: center.lng
lon: center.lng,
_csrf: '{{csrf}}'
},
timeout: 30000,
dataType: 'json',
Expand Down Expand Up @@ -2055,7 +2056,7 @@ function loadData () {
loadRequest = $.ajax({
url: '/api/get_data',
data: data,
type: 'post',
type: 'POST',
async: true,
success: function (data) {
const gyms = data.data.gyms;
Expand Down

0 comments on commit bc19e46

Please sign in to comment.