-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.js
More file actions
41 lines (37 loc) · 931 Bytes
/
api.js
File metadata and controls
41 lines (37 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function getLocationFromZipCode(zipcode, callback) {
var data = {
'action': 'google_maps_endpoint',
'google_maps_zipcode': zipcode
};
jQuery.get(ajax_object.ajax_url, data, function(response) {
callback(response);
})
.fail(function() {
callback(null);
});
}
function registerAudioMothUser(email, zip_code, serial_number, callback) {
var data = {
'action': 'audio_moth_endpoint',
'email': email,
'zip_code': zip_code,
'serial_number': serial_number
};
jQuery.post(ajax_object.ajax_url, data, function(response) {
callback(response);
})
.fail(function() {
callback(null);
});
}
function retrieveAudioMothUsers(callback) {
var data = {
'action': 'audio_moth_users_endpoint',
};
jQuery.get(ajax_object.ajax_url, data, function(response) {
callback(response);
})
.fail(function() {
callback(null);
});
}