14 lines
309 B
TypeScript
14 lines
309 B
TypeScript
export default defineEventHandler((event) => {
|
|
const config = useRuntimeConfig();
|
|
const id = getRouterParam(event, 'id');
|
|
|
|
if (!id) {
|
|
throw createError({
|
|
statusCode: 400,
|
|
message: 'Good ID is required',
|
|
});
|
|
}
|
|
|
|
return $fetch(`${config.public.backendUrl}/public/goods/${id}`);
|
|
});
|