Feature: As an end-user, I should be able to see the list of agents in the widget. (#461)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
33e0bd434b
commit
83b0bb4062
8
app/javascript/widget/api/agent.js
Normal file
8
app/javascript/widget/api/agent.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import endPoints from 'widget/api/endPoints';
|
||||
import { API } from 'widget/helpers/axios';
|
||||
|
||||
export const getAvailableAgents = async websiteToken => {
|
||||
const urlData = endPoints.getAvailableAgents(websiteToken);
|
||||
const result = await API.get(urlData.url, { params: urlData.params });
|
||||
return result;
|
||||
};
|
||||
@@ -18,8 +18,16 @@ const updateContact = id => ({
|
||||
url: `/api/v1/widget/messages/${id}${window.location.search}`,
|
||||
});
|
||||
|
||||
const getAvailableAgents = token => ({
|
||||
url: '/api/v1/widget/inbox_members',
|
||||
params: {
|
||||
website_token: token,
|
||||
},
|
||||
});
|
||||
|
||||
export default {
|
||||
sendMessage,
|
||||
getConversation,
|
||||
updateContact,
|
||||
getAvailableAgents,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user