18 lines
487 B
TypeScript
18 lines
487 B
TypeScript
import { apiFetch, jsonResponse } from '../../../../_lib/api';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export async function POST(
|
|
req: Request,
|
|
{ params }: { params: Promise<{ id: string }> },
|
|
): Promise<Response> {
|
|
const { id } = await params;
|
|
const body = await req.json();
|
|
const res = await apiFetch(`/admin/groups/${id}/share`, {
|
|
method: 'POST',
|
|
body: JSON.stringify(body),
|
|
});
|
|
const payload = await res.json();
|
|
return jsonResponse(payload, res.status);
|
|
}
|