fix(members/invites): unwrap ApiResponse before returning to client

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>
This commit is contained in:
2026-04-10 19:57:13 +02:00
committed by marcel
parent ed0f3c21fe
commit a6683d06bb
2 changed files with 34 additions and 1 deletions

View File

@@ -5,5 +5,5 @@ 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, { status: response?.status ?? 201 });
return json(data?.data, { status: response?.status ?? 201 });
};