20 lines
654 B
TypeScript
20 lines
654 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { useWorkflowStoreLogic } from '~/stores/workflow-store'
|
|
import { shipmentService } from '~/services/shipment'
|
|
import type { ShipmentData, ShipmentPayload } from '~/services/dto/shipment-data'
|
|
|
|
export const useShipmentStore = defineStore('shipment', () => {
|
|
const { current, isLoading, setCurrent, clearCurrent, load, create, update } =
|
|
useWorkflowStoreLogic<ShipmentData, ShipmentPayload>(shipmentService)
|
|
|
|
return {
|
|
current,
|
|
isLoading,
|
|
setCurrent,
|
|
clearCurrent,
|
|
loadShipment: load,
|
|
createShipment: create,
|
|
updateShipment: update
|
|
}
|
|
})
|