Changed direct messages channels so users can show/hide them
Этот коммит содержится в:
@@ -666,3 +666,27 @@ export function getDirectChannels() {
|
||||
);
|
||||
}
|
||||
|
||||
export function setPreferences(preferences, success, error) {
|
||||
client.setPreferences(
|
||||
preferences,
|
||||
(data, textStatus, xhr) => {
|
||||
if (xhr.status !== 304) {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECIEVED_PREFERENCES,
|
||||
preferences
|
||||
});
|
||||
}
|
||||
|
||||
if (success) {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'setPreferences');
|
||||
|
||||
if (error) {
|
||||
error();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1155,3 +1155,16 @@ export function getPreferencesByName(category, name, success, error) {
|
||||
});
|
||||
}
|
||||
|
||||
export function setPreferences(preferences, success, error) {
|
||||
$.ajax({
|
||||
url: '/api/v1/preferences/set',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: JSON.stringify(preferences),
|
||||
success,
|
||||
error: (xhr, status, err) => {
|
||||
var e = handleError('setPreferences', xhr, status, err);
|
||||
error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user