mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-22 04:31:15 +10:00
feat: annotated client routes
This commit is contained in:
@ -1,13 +1,12 @@
|
||||
import { defineClientEventHandler } from "~/server/internal/clients/event-handler";
|
||||
import newsManager from "~/server/internal/news";
|
||||
|
||||
/**
|
||||
* Fetch new article by ID
|
||||
* @param id Article ID
|
||||
*/
|
||||
export default defineClientEventHandler(async (h3) => {
|
||||
const id = h3.context.params?.id;
|
||||
if (!id)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
message: "Missing news ID",
|
||||
});
|
||||
const id = getRouterParam(h3, "id")!;
|
||||
|
||||
const news = await newsManager.fetchById(id);
|
||||
if (!news)
|
||||
|
||||
Reference in New Issue
Block a user