feat: allow adding custom attributes to conversations from the SDK (#6782)
* feat: add conversation attributes method to sdk and widget app * feat: add endpoints to update custom attributes * refactor: update SDK api * feat: add api and actions for conversation updates * fix: error message * test: custom attributes on conversations controller --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -6,6 +6,8 @@ import {
|
||||
toggleTyping,
|
||||
setUserLastSeenAt,
|
||||
toggleStatus,
|
||||
setCustomAttributes,
|
||||
deleteCustomAttribute,
|
||||
} from 'widget/api/conversation';
|
||||
|
||||
import { createTemporaryMessage, getNonDeletedMessages } from './helpers';
|
||||
@@ -139,4 +141,20 @@ export const actions = {
|
||||
resolveConversation: async () => {
|
||||
await toggleStatus();
|
||||
},
|
||||
|
||||
setCustomAttributes: async (_, customAttributes = {}) => {
|
||||
try {
|
||||
await setCustomAttributes(customAttributes);
|
||||
} catch (error) {
|
||||
// IgnoreError
|
||||
}
|
||||
},
|
||||
|
||||
deleteCustomAttribute: async (_, customAttribute) => {
|
||||
try {
|
||||
await deleteCustomAttribute(customAttribute);
|
||||
} catch (error) {
|
||||
// IgnoreError
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user