Merge branch 'develop' into chore.dehydrate-login-methods-from-rocketchatjs
This commit is contained in:
commit
f2a69e4894
|
@ -194,6 +194,10 @@ export type OmnichannelEndpoints = {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
'livechat/agents/:uid/departments?enabledDepartmentsOnly=true': {
|
||||||
|
GET: () => { departments: ILivechatDepartment[] };
|
||||||
|
};
|
||||||
|
|
||||||
'canned-responses': {
|
'canned-responses': {
|
||||||
GET: (params: PaginatedRequest<{ scope?: string; departmentId?: string; text?: string }>) => PaginatedResult<{
|
GET: (params: PaginatedRequest<{ scope?: string; departmentId?: string; text?: string }>) => PaginatedResult<{
|
||||||
cannedResponses: ICannedResponse[];
|
cannedResponses: ICannedResponse[];
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { store } from '../../../../lib/auxStore';
|
||||||
import RocketChat from '../../../../lib/rocketchat';
|
import RocketChat from '../../../../lib/rocketchat';
|
||||||
import { inquiryQueueAdd, inquiryQueueRemove, inquiryQueueUpdate, inquiryRequest } from '../../actions/inquiry';
|
import { inquiryQueueAdd, inquiryQueueRemove, inquiryQueueUpdate, inquiryRequest } from '../../actions/inquiry';
|
||||||
import sdk from '../../../../lib/rocketchat/services/sdk';
|
import sdk from '../../../../lib/rocketchat/services/sdk';
|
||||||
import { ILivechatDepartment } from '../../../../definitions/ILivechatDepartment';
|
|
||||||
import { IOmnichannelRoom } from '../../../../definitions';
|
import { IOmnichannelRoom } from '../../../../definitions';
|
||||||
|
|
||||||
interface IArgsQueueOmnichannel extends IOmnichannelRoom {
|
interface IArgsQueueOmnichannel extends IOmnichannelRoom {
|
||||||
|
@ -82,7 +81,7 @@ export default function subscribeInquiry() {
|
||||||
throw new Error('inquiry: @subscribeInquiry user.id not found');
|
throw new Error('inquiry: @subscribeInquiry user.id not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
RocketChat.getAgentDepartments(user.id).then((result: { success: boolean; departments: ILivechatDepartment[] }) => {
|
RocketChat.getAgentDepartments(user.id).then(result => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const { departments } = result;
|
const { departments } = result;
|
||||||
|
|
||||||
|
|
|
@ -395,10 +395,8 @@ export const getTagsList = (): Promise<
|
||||||
// RC 2.0.0
|
// RC 2.0.0
|
||||||
sdk.methodCallWrapper('livechat:getTagsList');
|
sdk.methodCallWrapper('livechat:getTagsList');
|
||||||
|
|
||||||
export const getAgentDepartments = (uid: string): any =>
|
export const getAgentDepartments = (uid: string) =>
|
||||||
// RC 2.4.0
|
// RC 2.4.0
|
||||||
// TODO: missing definitions from server
|
|
||||||
// @ts-ignore
|
|
||||||
sdk.get(`livechat/agents/${uid}/departments?enabledDepartmentsOnly=true`);
|
sdk.get(`livechat/agents/${uid}/departments?enabledDepartmentsOnly=true`);
|
||||||
|
|
||||||
export const getCustomFields = () =>
|
export const getCustomFields = () =>
|
||||||
|
|
|
@ -146,7 +146,7 @@ const LivechatEditView = ({
|
||||||
const getAgentDepartments = async () => {
|
const getAgentDepartments = async () => {
|
||||||
const result = await RocketChat.getAgentDepartments(visitor?._id);
|
const result = await RocketChat.getAgentDepartments(visitor?._id);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const agentDepartments = result.departments.map((dept: { departmentId: string }) => dept.departmentId);
|
const agentDepartments = result.departments.map(dept => dept.departmentId);
|
||||||
getTagsList(agentDepartments);
|
getTagsList(agentDepartments);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue