2016-09-24 15:28:11 +00:00
|
|
|
/* global $ */
|
|
|
|
|
2016-09-22 10:31:56 +00:00
|
|
|
/*
|
2016-09-24 15:28:11 +00:00
|
|
|
* Dependencies:
|
|
|
|
* Metamaps.Backbone
|
2016-09-22 10:31:56 +00:00
|
|
|
*/
|
2016-04-14 05:54:19 +00:00
|
|
|
|
2016-09-22 07:21:59 +00:00
|
|
|
const Mapper = {
|
2016-04-14 05:54:19 +00:00
|
|
|
// this function is to retrieve a mapper JSON object from the database
|
|
|
|
// @param id = the id of the mapper to retrieve
|
|
|
|
get: function (id, callback) {
|
2016-09-24 15:28:11 +00:00
|
|
|
$.ajax({
|
|
|
|
url: `/users/${id}.json`,
|
|
|
|
success: data => {
|
|
|
|
callback(new Metamaps.Backbone.Mapper(data))
|
|
|
|
}
|
2016-04-14 05:54:19 +00:00
|
|
|
})
|
|
|
|
}
|
2016-09-22 07:21:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Mapper
|