summaryrefslogtreecommitdiffstats
path: root/web/react/utils/client.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2015-10-13 18:23:53 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2015-10-13 18:23:53 -0400
commit56b02f2ebab6646b1d978b8f873d4949670967e2 (patch)
tree687fa2ccd73e1e122a56a3b9c9deedc18096bcbf /web/react/utils/client.jsx
parent998b5f7e11ac07a482e88f5d3ef4fd726cf0c99a (diff)
parent97b2f6ffe7fa09a2188163740865322582b00b59 (diff)
downloadchat-56b02f2ebab6646b1d978b8f873d4949670967e2.tar.gz
chat-56b02f2ebab6646b1d978b8f873d4949670967e2.tar.bz2
chat-56b02f2ebab6646b1d978b8f873d4949670967e2.zip
Merge pull request #968 from hmhealey/plt322
PLT-322 Updated Direct Messages menu
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r--web/react/utils/client.jsx28
1 files changed, 28 insertions, 0 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 6dccfcdeb..76a402855 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -1141,3 +1141,31 @@ export function listIncomingHooks(success, error) {
}
});
}
+
+export function getPreferenceCategory(category, success, error) {
+ $.ajax({
+ url: `/api/v1/preferences/${category}`,
+ dataType: 'json',
+ type: 'GET',
+ success,
+ error: (xhr, status, err) => {
+ var e = handleError('getPreferenceCategory', xhr, status, err);
+ error(e);
+ }
+ });
+}
+
+export function savePreferences(preferences, success, error) {
+ $.ajax({
+ url: '/api/v1/preferences/save',
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'POST',
+ data: JSON.stringify(preferences),
+ success,
+ error: (xhr, status, err) => {
+ var e = handleError('savePreferences', xhr, status, err);
+ error(e);
+ }
+ });
+}