Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/component/recent-list/src/menu/ |
Upload File : |
import {ajax as Ajax, Loc} from 'main.core'; const resendAction = 'intranet.controller.invite.reinvite'; const cancelAction = 'intranet.controller.invite.deleteinvitation'; export const InviteManager = { resendInvite(userId: number) { const data = { params: {userId} }; Ajax.runAction(resendAction, {data}).then(() => { this.showNotification(Loc.getMessage('IM_RECENT_CONTEXT_MENU_INVITE_RESEND_DONE'), 2000); }, (error) => { this.handleActionError(error); }); }, cancelInvite(userId: number) { const data = { params: {userId} }; Ajax.runAction(cancelAction, {data}).then(() => { this.showNotification(Loc.getMessage('IM_RECENT_CONTEXT_MENU_INVITE_CANCEL_DONE'), 2000); }, (error) => { this.handleActionError(error); }); }, showNotification(text: string, autoHideDelay: number = 4000) { BX.UI.Notification.Center.notify({ content: text, autoHideDelay }); }, handleActionError(error: Object) { if (error.status === 'error' && error.errors.length > 0) { const errorContent = error.errors.map((element) => { return element.message; }).join('. '); this.showNotification(errorContent); return true; } this.showNotification(Loc.getMessage('IM_RECENT_CONNECT_ERROR')); } };