import axios from 'axios';

import { addAuthIntercepter } from '@/utils/api/intercepters/request/authIntercepter';

const api = axios.create({
  baseURL: `/service/ervu-person-registry`
});

addAuthIntercepter(api);

function responseData(requestPromise) {
  return requestPromise.then(response => response.data);
}

export const menuCounters = {
  flags() {
    return responseData(
      api.get('/menu-counts')
    );
  },
  numbers() {
    return responseData(
      api.get('/menu-counts/num')
    );
  },
}
