/* global defineEventHandler, createError */ import { database, data } from "~/server/utils/database"; import { client } from "~/utils/types/database"; export default defineEventHandler(async (e) => { const id = e.context.params?.id; const [data] = await database.query( "SELECT *, CONVERT(`id`, CHAR) AS `id` FROM `clients` WHERE `id` = ?", [id], ) as unknown as data; if (!data[0]) { throw createError({ statusCode: 404, }); } return data[0]; });