text: import axios from "axios";
  import { globalConstants } from "../constants";
  import { handleApiResponseError } from "../utils/apiErrorHandler";
  import { getToken } from '../utils/SesssionStorage';
  import { electionApi } from "../services/electionApiService";
  
  
  
  export const electionScheduleModel = async ( callback = {} ) => {
  
      try {
          const response = await axios.get( electionApi.SCHEDULES, {
              ...globalConstants.GET_HEADER,
              headers: {
                  Authorization: `Bearer ${getToken()}`
              }
          } );
          const { status, data } = response.data;
          if ( status === 200 ) {
              return callback.success( data )
          }
          else {
              return callback.error( handleApiResponseError( data ) )
          }
      }
      catch ( error ) {
          if ( error && error.response ) {
              if ( callback.error ) {
                  callback.error( handleApiResponseError( error.response.data ) );
              }
          }
      }
  
  }