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

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