import { createAsyncThunk } from "@reduxjs/toolkit";
import httpService from "./httpService";

export const getOrders = createAsyncThunk('wooArchive/orders',async (paged)=>{
    try {
        const { data } = await httpService.get("/wooArchive/api/v1/orders",{
            params: { paged }
        })
        return data
    }catch (error) {
        return error.message;
    }
})

export const insertOrders = createAsyncThunk('wooArchive/order/insert',async (orderData)=>{
    try {
        const { data } = await httpService.post("/wooArchive/api/v1/orders",orderData)
        return data
    }catch (e) {
        return e.message;
    }
})