Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/blue-books-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rocket.chat/meteor": patch
"@rocket.chat/rest-typings": patch
---

Fixes an issue that prevented the action of saving an agent when editing a department to work.
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,8 @@ import { IS_EE } from '../../../e2e/config/constants';
const res = await request
.post(api(`livechat/department/${dep._id}/agents`))
.set(credentials)
.send({ upsert: [{ agentId: agent._id, username: agent.username }], remove: [] })
// UI sends agent name as well. API doens't use it, but keeping here for avoid Breaking Changes
.send({ upsert: [{ agentId: agent._id, username: agent.username, name: agent.name }], remove: [] })
.expect(200);
expect(res.body).to.have.property('success', true);
await deleteDepartment(dep._id);
Expand Down
8 changes: 6 additions & 2 deletions packages/rest-typings/src/v1/omnichannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export const isLivechatDepartmentDepartmentIdAgentsGETProps = ajv.compile<Livech
);

type LivechatDepartmentDepartmentIdAgentsPOST = {
upsert: { agentId: string; username: string; count?: number; order?: number }[];
remove: { agentId: string; username: string; count?: number; order?: number }[];
upsert: { agentId: string; username: string; name?: string; count?: number; order?: number }[];
remove: { agentId: string; username: string; name?: string; count?: number; order?: number }[];
};

const LivechatDepartmentDepartmentIdAgentsPOSTSchema = {
Expand All @@ -183,6 +183,7 @@ const LivechatDepartmentDepartmentIdAgentsPOSTSchema = {
username: {
type: 'string',
},
name: { type: 'string' },
count: {
type: 'number',
},
Expand All @@ -205,6 +206,9 @@ const LivechatDepartmentDepartmentIdAgentsPOSTSchema = {
username: {
type: 'string',
},
name: {
type: 'string',
},
count: {
type: 'number',
},
Expand Down
Loading