Skip to content

Commit 17c0233

Browse files
feat: show user an error if there is no api key configuration before sending it to the backend (#10278)
1 parent 449ba7a commit 17c0233

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

apps/google-docs/src/locations/Page.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ const Page = () => {
3030

3131
const handleSubmit = async () => {
3232
// Validation
33+
const openAiApiKey = sdk.parameters.installation?.openAiApiKey as string | undefined;
34+
35+
if (!openAiApiKey || !openAiApiKey.trim()) {
36+
setErrorMessage('OpenAI API key is not configured. Please configure it in the app settings.');
37+
setSuccessMessage(null);
38+
return;
39+
}
40+
3341
if (!googleDocUrl.trim()) {
3442
setErrorMessage('Please enter a Google Doc URL');
3543
setSuccessMessage(null);

0 commit comments

Comments
 (0)