Chatwoot/app/javascript/dashboard/api/endPoints.js
Muhsin Keloth b668723313
chore: Ability to change default account (#5393)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com>
2022-10-05 17:31:12 -07:00

51 lines
933 B
JavaScript

/* eslint arrow-body-style: ["error", "always"] */
const endPoints = {
resetPassword: {
url: 'auth/password',
},
register: {
url: 'api/v1/accounts.json',
},
validityCheck: {
url: '/auth/validate_token',
},
profileUpdate: {
url: '/api/v1/profile',
},
availabilityUpdate: {
url: '/api/v1/profile/availability',
},
logout: {
url: 'auth/sign_out',
},
me: {
url: 'api/v1/conversations.json',
params: { type: 0, page: 1 },
},
getInbox: {
url: 'api/v1/conversations.json',
params: { inbox_id: null },
},
fetchFacebookPages: {
url(accountId) {
return `api/v1/accounts/${accountId}/callbacks/facebook_pages.json`;
},
params: { omniauth_token: '' },
},
deleteAvatar: {
url: '/api/v1/profile/avatar',
},
setActiveAccount: {
url: '/api/v1/profile/set_active_account',
},
};
export default page => {
return endPoints[page];
};