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:
@@ -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 });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user