HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/buyercall/assets/vue/service/partnershipService.js
import BuyerGatewayMock from '../gateway/mockGateway';
import BuyerGateway from '../gateway/gateway';
import { serializeForm } from '../utils/util';

const getPartnerships = () => BuyerGateway.get('/partnerships');
const addPartnership = postData => {
  serializeForm(postData);
  return BuyerGateway.post('/partnership/add', postData);
};

const getPartnershipDetails = id => BuyerGateway.get(`/partnership/${id}`);

const deactivatePartnerUser = (partnerId, userId) =>
  BuyerGateway.delete(`/partnership/user/deactivate/${partnerId}/${userId}`);
const resendUserInvitation = (partnerId, userId) =>
  BuyerGateway.get(`/partnership/${partnerId}/user/${userId}/resendinvite`);
const remoteAcccessPartnerUser = (partnerId, userId) =>
  BuyerGateway.get(`/partnership/${partnerId}/user/${userId}/remoteaccess`);

const getPartnershipBillingTypes = () =>
  BuyerGateway.get('/partnership/billingtypes');

const getPartnershipBusinessTypes = () =>
  BuyerGateway.get('/partnership/businesstypes');

const getPartnershipTypes = () => BuyerGateway.get('/partnership/types');
const updatePartnershipAccountRestrictions = postRequest => {
  console.log('postRequest', postRequest);
  return BuyerGateway.post('/partnership/accountrestrictions', postRequest);
};

const closePartnershipAccount = partnerId =>
  BuyerGateway.get(`/partnership/${partnerId}/closeaccount`);

const updatePartnershipSettings = (partnerId, postData) => {
  serializeForm(postData);
  console.log(partnerId);
  return BuyerGateway.post(`/partnership/settings/${partnerId}`, postData);
};

const updateWhiteLabelConfig = (partnerId, postData) => {
  return BuyerGateway.post(
    `/partnership/update-whitelabel-config/${partnerId}`,
    postData,
  );
};

export default {
  getPartnerships,
  getPartnershipDetails,
  deactivatePartnerUser,
  getPartnershipBillingTypes,
  getPartnershipBusinessTypes,
  getPartnershipTypes,
  remoteAcccessPartnerUser,
  updatePartnershipAccountRestrictions,
  closePartnershipAccount,
  updatePartnershipSettings,
  resendUserInvitation,
  addPartnership,
  updateWhiteLabelConfig,
};