Commit 806925fa authored by chdorner's avatar chdorner

Add update profile endpoint to store

parent 126bcbe9
...@@ -145,6 +145,7 @@ function store($http, $q, auth, settings) { ...@@ -145,6 +145,7 @@ function store($http, $q, auth, settings) {
}, },
profile: { profile: {
read: apiCall('profile.read'), read: apiCall('profile.read'),
update: apiCall('profile.update'),
}, },
}; };
} }
......
...@@ -76,6 +76,10 @@ describe('store', function () { ...@@ -76,6 +76,10 @@ describe('store', function () {
method: 'GET', method: 'GET',
url: 'http://example.com/api/profile', url: 'http://example.com/api/profile',
}, },
update: {
method: 'PATCH',
url: 'http://example.com/api/profile',
},
}, },
}, },
}); });
...@@ -158,4 +162,16 @@ describe('store', function () { ...@@ -158,4 +162,16 @@ describe('store', function () {
.respond(function () { return [200, profile, {}]; }); .respond(function () { return [200, profile, {}]; });
$httpBackend.flush(); $httpBackend.flush();
}); });
it("updates a user's profile", function (done) {
store.profile.update({}, {preferences: {}}).then(function () {
done();
});
$httpBackend.expectPATCH('http://example.com/api/profile')
.respond(function () {
return [200, {}, {}];
});
$httpBackend.flush();
});
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment