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

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