import {NextRequest, NextResponse} from "next/server"; import {RouteContext} from "@/types/common"; import {createNotihubApi} from "@/lib/http-server"; import {errorToResponse} from "@kri/common/http"; import {Template, TemplateSummary} from "@/types/messageTemplate"; export const GET = async (req: NextRequest, context: RouteContext) => { try{ const { searchParams } = new URL(req.url); const {slug = []} = await context.params; const [action] = slug; const notihubApi = await createNotihubApi(); if(slug.length === 1){ const result = await notihubApi.get