POST /members/invites was returning the full ApiResponseInviteResponse wrapper. The client set activeInvite directly from the response body, so shareUrl/inviteCode/expiresAt were missing (nested under .data). Fixed to return data?.data — the inner InviteResponse — matching the shape that InvitePanel and page.server.ts already expect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 lines
363 B
TypeScript
10 lines
363 B
TypeScript
import { json } from '@sveltejs/kit';
|
|
import type { RequestHandler } from './$types';
|
|
import { apiClient } from '$lib/server/api';
|
|
|
|
export const POST: RequestHandler = async ({ fetch }) => {
|
|
const api = apiClient(fetch);
|
|
const { data, response } = await api.POST('/v1/households/mine/invites');
|
|
return json(data?.data, { status: response?.status ?? 201 });
|
|
};
|