Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default async function Dashboard({
<p className="text-muted-foreground text-lg mb-4">No sessions yet, create one to get started.</p>
<div className="flex justify-center gap-4">
<CreateSessionButton text="Get Started" />
<Link href="https://harmonica.chat/support" target="_blank">
<Link href="https://help.harmonica.chat/quickstart" target="_blank">
<Button variant="outline">
How it works
</Button>
Expand Down
7 changes: 7 additions & 0 deletions src/app/api/v1/sessions/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const ALLOWED_UPDATE_FIELDS: (keyof UpdateSessionRequest)[] = [
'context',
'critical',
'prompt',
'cross_pollination',
'distribution',
];

export async function PATCH(
Expand Down Expand Up @@ -78,6 +80,11 @@ export async function PATCH(
update.prompt_summary = update.prompt.substring(0, 500);
}

// Serialize distribution array to JSON string for storage
if (update.distribution !== undefined) {
update.distribution = update.distribution ? JSON.stringify(update.distribution) : null;
}

if (Object.keys(update).length === 0) {
return validationError(
'No valid fields provided. Allowed fields: ' +
Expand Down
2 changes: 2 additions & 0 deletions src/lib/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export interface UpdateSessionRequest {
context?: string;
critical?: string;
prompt?: string;
cross_pollination?: boolean;
distribution?: DistributionTarget[];
}

export interface SessionCreated extends SessionListItem {
Expand Down
Loading