-
Notifications
You must be signed in to change notification settings - Fork 13.1k
fix: unable to clear contact manager field #38265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
abhinavkrin
wants to merge
15
commits into
develop
Choose a base branch
from
fix/clear-contact-manager-field
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8d84323
fix: api cannot clear contact manager field
abhinavkrin 28e043e
added changeset
abhinavkrin 89e8a70
fix: contactManager could not be cleared
abhinavkrin 1cfc17c
Update thick-ties-hunt.md
abhinavkrin 96b64fa
fixes
abhinavkrin 14c87b6
fixes
abhinavkrin e863058
fixes
abhinavkrin 1d77724
fixes
abhinavkrin 59044f6
Apply suggestion from @cubic-dev-ai[bot]
abhinavkrin 7d3ae69
requested changes
abhinavkrin 2a05f70
added unit tests
abhinavkrin 8a7f771
minor changes
abhinavkrin acd1f78
minor changes in tests
abhinavkrin 33b0ed2
update changeset
abhinavkrin cd06be0
requested changes
abhinavkrin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@rocket.chat/models': patch | ||
| '@rocket.chat/model-typings': patch | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Fixes endpoints `omnichannel/contacts.update` and `omnichannel/contacts.conflicts` where the contact manager field could not be cleared. |
14 changes: 14 additions & 0 deletions
14
apps/meteor/app/livechat/server/lib/contacts/patchContact.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import type { ILivechatContact } from '@rocket.chat/core-typings'; | ||
| import { LivechatContacts } from '@rocket.chat/models'; | ||
|
|
||
| export const patchContact = async ( | ||
| contactId: ILivechatContact['_id'], | ||
| data: { set?: Partial<ILivechatContact>; unset?: Partial<Record<keyof ILivechatContact, '' | 1>> }, | ||
| ): Promise<ILivechatContact | null> => { | ||
| const { set = {}, unset = {} } = data; | ||
|
|
||
| if (Object.keys(set).length === 0 && Object.keys(unset).length === 0) { | ||
| return LivechatContacts.findOneEnabledById(contactId); | ||
| } | ||
| return LivechatContacts.patchContact(contactId, data); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.