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:
@@ -50,6 +50,24 @@ const toggleStatus = async () => {
|
||||
);
|
||||
};
|
||||
|
||||
const setCustomAttributes = async customAttributes => {
|
||||
return API.post(
|
||||
`/api/v1/widget/conversations/set_custom_attributes${window.location.search}`,
|
||||
{
|
||||
custom_attributes: customAttributes,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const deleteCustomAttribute = async customAttribute => {
|
||||
return API.post(
|
||||
`/api/v1/widget/conversations/destroy_custom_attributes${window.location.search}`,
|
||||
{
|
||||
custom_attribute: [customAttribute],
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
export {
|
||||
createConversationAPI,
|
||||
sendMessageAPI,
|
||||
@@ -60,4 +78,6 @@ export {
|
||||
setUserLastSeenAt,
|
||||
sendEmailTranscript,
|
||||
toggleStatus,
|
||||
setCustomAttributes,
|
||||
deleteCustomAttribute,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user