Move integrations over to redux and v4 (#6679)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
1594cf8af1
Коммит
ef9326bcbb
@@ -712,222 +712,6 @@ export function getRecentAndNewUsersAnalytics(teamId) {
|
||||
);
|
||||
}
|
||||
|
||||
export function addIncomingHook(hook, success, error) {
|
||||
Client.addIncomingHook(
|
||||
hook,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_INCOMING_WEBHOOK,
|
||||
incomingWebhook: data
|
||||
});
|
||||
|
||||
if (success) {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'addIncomingHook');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function updateIncomingHook(hook, success, error) {
|
||||
Client.updateIncomingHook(
|
||||
hook,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.UPDATED_INCOMING_WEBHOOK,
|
||||
incomingWebhook: data
|
||||
});
|
||||
|
||||
if (success) {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'updateIncomingHook');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function addOutgoingHook(hook, success, error) {
|
||||
Client.addOutgoingHook(
|
||||
hook,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_OUTGOING_WEBHOOK,
|
||||
outgoingWebhook: data
|
||||
});
|
||||
|
||||
if (success) {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'addOutgoingHook');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function updateOutgoingHook(hook, success, error) {
|
||||
Client.updateOutgoingHook(
|
||||
hook,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.UPDATED_OUTGOING_WEBHOOK,
|
||||
outgoingWebhook: data
|
||||
});
|
||||
|
||||
if (success) {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'updateOutgoingHook');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteIncomingHook(id) {
|
||||
Client.deleteIncomingHook(
|
||||
id,
|
||||
() => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.REMOVED_INCOMING_WEBHOOK,
|
||||
teamId: Client.teamId,
|
||||
id
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'deleteIncomingHook');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteOutgoingHook(id) {
|
||||
Client.deleteOutgoingHook(
|
||||
id,
|
||||
() => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.REMOVED_OUTGOING_WEBHOOK,
|
||||
teamId: Client.teamId,
|
||||
id
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'deleteOutgoingHook');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function regenOutgoingHookToken(id) {
|
||||
Client.regenOutgoingHookToken(
|
||||
id,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.UPDATED_OUTGOING_WEBHOOK,
|
||||
outgoingWebhook: data
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'regenOutgoingHookToken');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function addCommand(command, success, error) {
|
||||
Client.addCommand(
|
||||
command,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_COMMAND,
|
||||
command: data
|
||||
});
|
||||
|
||||
if (success) {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'addCommand');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function editCommand(command, success, error) {
|
||||
Client.editCommand(
|
||||
command,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.UPDATED_COMMAND,
|
||||
command: data
|
||||
});
|
||||
|
||||
if (success) {
|
||||
success(data);
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (error) {
|
||||
error(err);
|
||||
} else {
|
||||
dispatchError(err, 'editCommand');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteCommand(id) {
|
||||
Client.deleteCommand(
|
||||
id,
|
||||
() => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.REMOVED_COMMAND,
|
||||
teamId: Client.teamId,
|
||||
id
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'deleteCommand');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function regenCommandToken(id) {
|
||||
Client.regenCommandToken(
|
||||
id,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.UPDATED_COMMAND,
|
||||
command: data
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
dispatchError(err, 'regenCommandToken');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export function getPublicLink(fileId, success, error) {
|
||||
const callName = 'getPublicLink' + fileId;
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user