Skip to content

Commit

Permalink
refactor(PromptEditForm.svelte): add fade transition to the fieldset …
Browse files Browse the repository at this point in the history
…element for a smoother visual effect

fix(refinePrompt/server.ts): change ENV_OPENAI_API_KEY variable name to SECRET_OPENAI_API_KEY for clarity and consistency
  • Loading branch information
edwardspresume committed Jul 24, 2023
1 parent 1cb08d8 commit a53760d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/lib/components/Forms/PromptEditForm.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script lang="ts">
import { superForm } from 'sveltekit-superforms/client';
import { fade } from 'svelte/transition';
import { writable } from 'svelte/store';
import type { ConfirmationInfo, PromptSchema } from '$types';
Expand Down Expand Up @@ -173,7 +175,7 @@
/>

{#if isRefinedPromptVisible}
<fieldset>
<fieldset transition:fade={{ delay: 250, duration: 300 }}>
<div class="flex justify-end gap-2 mb-2">
<button
type="button"
Expand Down
4 changes: 2 additions & 2 deletions src/routes/api/refinePrompt/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ENV_OPENAI_API_KEY } from '$env/static/private';
import { SECRET_OPENAI_API_KEY } from '$env/static/private';
import type { RequestHandler } from './$types';

import { PromptValidationSchema } from '$utils/validation/promptValidationSchema';
Expand All @@ -10,7 +10,7 @@ import { PromptValidationSchema } from '$utils/validation/promptValidationSchema
* @throws Will throw an error if the API call fails or environment variable is missing
*/
async function fetchRefinedPrompt(promptText: string) {
const OPENAI_API_KEY = ENV_OPENAI_API_KEY;
const OPENAI_API_KEY = SECRET_OPENAI_API_KEY;

if (!OPENAI_API_KEY) {
throw new Error(
Expand Down

0 comments on commit a53760d

Please sign in to comment.