metamaps--metamaps/frontend/src/Metamaps/Mapper.js

19 lines
384 B
JavaScript
Raw Normal View History

/* global $ */
import DataModel from './DataModel'
2016-04-14 05:54:19 +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
2016-11-07 20:25:08 +00:00
get: function(id, callback) {
$.ajax({
url: `/users/${id}.json`,
success: data => {
callback(new DataModel.Mapper(data))
}
2016-04-14 05:54:19 +00:00
})
}
}
export default Mapper