Skip to content

Commit

Permalink
Update examples/ai-image-generator/pages/index.jsx
Browse files Browse the repository at this point in the history
Co-authored-by: Kirill Sudarushkin <[email protected]>
  • Loading branch information
horeaporutiu and kirillsud authored Sep 19, 2023
1 parent 3df032a commit 8840abd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/ai-image-generator/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default function Main({ boards, authUrl }) {
setResponse("");

// post our prompt to our backend
try {
const response = await fetch("/api/openai", {
method: "POST",
headers: {
Expand All @@ -103,6 +104,9 @@ export default function Main({ boards, authUrl }) {
console.log(imageUrl);
setResponse(imageUrl);
document.querySelector("#image").src = imageUrl;
} finally {
removeSpinner();
}
removeSpinner();
};

Expand Down

0 comments on commit 8840abd

Please sign in to comment.