Journal dashboard widgets and quick-add; rich-text quick-add dialogs. Dashboard draft sync for live edit previews; assistant bubble + API tools. Journal UX: stress slider, mood grid, query cap fix.
14 lines
634 B
TypeScript
14 lines
634 B
TypeScript
import { apiJson, withApiHandler } from "@/lib/api-handler";
|
|
import { scheduleOnCalendarForScope } from "@/modules/garden/server/actions";
|
|
import { scheduleOnCalendarInput } from "@/modules/garden/server/schemas";
|
|
|
|
export async function POST(request: Request, { params }: { params: Promise<{ id: string }> }) {
|
|
const { id } = await params;
|
|
return withApiHandler(request, async (scope, req) => {
|
|
const body: unknown = await req.json();
|
|
const parsed = scheduleOnCalendarInput.parse({ ...(body as object), scheduleId: id });
|
|
await scheduleOnCalendarForScope(scope, parsed);
|
|
return apiJson({ ok: true }, 201);
|
|
});
|
|
}
|