import { createAsyncThunk } from '@reduxjs/toolkit';
import axios from 'axios';
import { PizzaToCard, GetPizzaParams } from './types';
import pickBy from 'lodash/pickBy';
import identity from 'lodash/identity';

export const fetchPizzaToCard = createAsyncThunk<PizzaToCard[], GetPizzaParams>(
    'pizza/fetchPizzaStatus',
    async (params) => {
        const { id } = params;
        const { data } = await axios.get<PizzaToCard[]>(`/api/loadingPizzaInformation/`+id)
        console.log(data, 'stock');
        return data;
    },
  );