import strapiHelper from "../../../../../utils/strapiHelper"

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

  try {
    await strapiHelper(event, `upload/files/${id}`, 'DELETE', null)
  } catch(error: any) {
    data = {
      status: error.status || error.statusCode || 500,
      message: error.detail || error.message || error.statusMessage
    }
  }

  return data
})