Skip to content

Commit

Permalink
fix(ui): fix 500 on empty prompt (#86)
Browse files Browse the repository at this point in the history
## Why this fix?

If we send an empty string, the UI returns 500 error.


<img width="1214" alt="image"
src="https://github.com/astronomer/ask-astro/assets/5144808/a29730dc-ebfd-4afe-befb-86429e4f95be">

## After this fix

The AI asks what it can help which seems to be a more user-friendly
response

<img width="1197" alt="image"
src="https://github.com/astronomer/ask-astro/assets/5144808/378f9101-b8bc-42d2-9aef-7cbfee3a565d">

closes: #82
  • Loading branch information
Lee-W authored Nov 7, 2023
1 parent 4c92922 commit 581fab8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ui/src/routes/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export const actions = {
const prompt = formData.get("prompt")?.toString();
const from_request_uuid = formData.get("from_request_uuid");

if (!prompt) throw new Error("Prompt is required");

const body: { prompt: string; from_request_uuid?: string } = {
prompt,
};
Expand Down

0 comments on commit 581fab8

Please sign in to comment.