import { createAsyncThunk } from '@reduxjs/toolkit';
import axios from 'axios';
import { Categories } from './types';

export const fetchCategories = createAsyncThunk(
    'Categories/fetchCategoriesStatus',
    async () => {
      const { data } = await axios.get<Categories[]>(`/api/loadingCategories`);
     // console.log(data);
      return data;
    },
  );