/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-var-requires */
import { environment } from '../../enviroments/enviroments';
const axios = require('axios');

export function getStorageList(token: any, page: any): any {
  const responce = axios({
    method: 'get',
    baseURL: `${
      environment.localhost + environment.localeRu + environment.apiPrefix
    }`,
    url: page
      ? `${environment.endPoints.store}?page=${page}`
      : `${environment.endPoints.store}`,
    headers: {
      Authorization: `Token ${token}`,
      'Content-Type': 'application/json',
    },
  });
  return responce;
}

export function delStorageRecord(token: any, id: any): any {
  const responce = axios({
    method: 'delete',
    baseURL: `${
      environment.localhost + environment.localeRu + environment.apiPrefix
    }`,
    url: `${environment.endPoints.store}${id}/`,
    headers: {
      Authorization: `Token ${token}`,
    },
  });
  return responce;
}
