import { string } from 'alga-js'
import sendcloudHelper from "../../../../utils/sendcloudHelper"

export default defineEventHandler(async (event) => {
  let data: any = null
  const id = getRouterParam(event, 'id')

  try {
    const res: any = await sendcloudHelper(`parcels/${id}`, 'GET', null)
    if(res?.parcel) {
      data = res.parcel
    }
  } catch(error: any) {}

  return data
})