Code cleanup

This commit is contained in:
Austin Chen 2022-10-12 09:48:58 -07:00
parent 86e418cca8
commit 490867d403

View File

@ -77,17 +77,13 @@ function DreamTab(props: {
async function dream() { async function dream() {
setIsDreaming(true) setIsDreaming(true)
const url = `/api/v0/dream`
const data = { const data = {
prompt: input + ', ' + MODIFIERS, prompt: input + ', ' + MODIFIERS,
apiKey: API_KEY, apiKey: API_KEY,
} }
const headers = { const response = await fetch(`/api/v0/dream`, {
'Content-Type': 'application/json',
}
const response = await fetch(url, {
method: 'POST', method: 'POST',
headers, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data), body: JSON.stringify(data),
}) })
const json = await response.json() const json = await response.json()