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/notificationService.js
import BuyerGatewayMock from '../gateway/mockGateway';
import Gateway from '../gateway/gateway';

const getUserNotifications = (limit, offset) =>
  Gateway.get(
    `/notifications/get-all-unviewed/?limit=${limit}&offset=${offset}`,
  );
const getUnviewiedCount = () =>
  Gateway.get('/notifications/get-unviewed-count');

const updateIsViewedFlag = notificationIds =>
  Gateway.post('/notifications/update-viewed', {
    notificationIds: notificationIds,
  });

const getUserNotificationStatus = () =>
  Gateway.get('/notifications/get-status');

const updateUserNotificationStatus = postdata =>
  Gateway.post('/notifications/update-status', {
    isSubscribed: postdata,
  });

const updateIsReadFlag = notificationIds =>
  Gateway.post('notifications/update-read', {
    notificationIds: notificationIds,
  });

const logNotifications = (user_id, notify_type) => {
  return Gateway.post('/notification/log', {
    user_id,
    notify_type,
  });
};

export default {
  getUserNotifications,
  getUnviewiedCount,
  updateIsViewedFlag,
  getUserNotificationStatus,
  updateUserNotificationStatus,
  updateIsReadFlag,
  logNotifications,
};