import { request } from '../../../utils';
import { API } from '../../../types';
import { ResponseType } from '../response-type';

export interface PostGetLastUpdate extends ResponseType {
  date: string;
}

export const appApi = {
  deleteUser: (token: string) => request.postForm(API.DELETE_USER, { token }),
  getLastRegionsUpdate: (date: string) =>
    request.postForm<PostGetLastUpdate>(API.GET_LAST_REGIONS_DB_UPDATE, { date }),
  getLastDareUpdate: (date: string) =>
    request.postForm<PostGetLastUpdate>(API.GET_LAST_DARE_DB_UPDATE, { date })
};
