import BaseService from './BaseService';

const ApiService = {
  fetchData(param) {
    return new Promise((resolve, reject) => {
      BaseService(param)
        .then((response) => {
          if (typeof response.data === 'object' && response.data !== null) {
            response.data.errorCodes = [{ statusCode: 200, errorMessages: 'THR_OPERATION_ACCOMPLISHED_SUCCESSFULLY' }];
          }
          resolve(response);
        })
        .catch((errors) => {
          reject(errors);
        });
    });
  },
};

export default ApiService;
