- Remove unnecessary attributes that cause additional SQL queries - Remove unneeded check for nil on current_item
15 lines
297 B
JavaScript
15 lines
297 B
JavaScript
let CurrentUser = {};
|
|
|
|
CurrentUser.data = function(key) {
|
|
return $("body").data(`current-user-${key}`);
|
|
};
|
|
|
|
CurrentUser.update = function(settings) {
|
|
return $.ajax(`/users/${CurrentUser.data("id")}.json`, {
|
|
method: "PUT",
|
|
data: { user: settings }
|
|
});
|
|
};
|
|
|
|
export default CurrentUser;
|