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/profileService.js
import BuyerGatewayMock from '../gateway/mockGateway';
import BuyerGateway from '../gateway/gateway';
import { serializeForm } from '../utils/util';

const updateProfileInfo = data => {
  console.log(serializeForm(data));

  return BuyerGateway.post('/profile/information', data);
};

const updateProfileSecurityInfo = data => {
  console.log(data);
  return BuyerGateway.post('/profile/security-information', data);
};

const updateProfile2FA = data => {
  console.log(data);
  return BuyerGateway.post('/profile/two-factor-authentication', data);
};

const updateProfileThemeSettings = data => {
  console.log(data);
  return BuyerGateway.post('/profile/theme-settings', data);
};

const getProfileInfo = () => BuyerGateway.get('/profile');

const getInAppNotificationSettings = () =>
  BuyerGateway.get('/profile/in-app-notification-settings');
const updateInAppNotificationSettings = postdata =>
  BuyerGateway.post('/profile/in-app-notification-settings', postdata);

const getEmailNotificationSettings = () =>
  BuyerGateway.get('/profile/email-notification-settings');
const updateEmailNotificationSettings = postdata =>
  BuyerGateway.post('/profile/email-notification-settings', postdata);

const getUserScheduleInfo = () => BuyerGateway.get('/agents/get-schedule');
const updateUserScheduleInfo = (userId, postData) =>
  BuyerGateway.post(`/agents/update-schedule/${userId}`, postData);

export default {
  getEmailNotificationSettings,
  updateEmailNotificationSettings,
  getInAppNotificationSettings,
  updateInAppNotificationSettings,
  updateProfileInfo,
  updateProfileSecurityInfo,
  updateProfile2FA,
  updateProfileThemeSettings,
  getProfileInfo,
  getUserScheduleInfo,
  updateUserScheduleInfo,
};