try call without include credentials

This commit is contained in:
wil committed 2024-04-11 13:16:31 -04:00
1 parent 94012e90f6
commit 925e488a56
1 file changed
+1 -36
@@ -24,7 +24,7 @@ export async function GenerateTtsAudio(request: GenerateTtsAudioRequest) : Promi
'Accept': 'application/json',
'Content-Type': 'application/json',
},
credentials: 'include',
// credentials: 'include',
body: JSON.stringify(request),
})
.then(res => res.json())
@@ -47,39 +47,4 @@ export async function GenerateTtsAudio(request: GenerateTtsAudioRequest) : Promi
return { error: GenerateTtsAudioErrorType.UnknownError };
});
// return await fetch(inferTts, {
// method: 'POST',
// headers: {
// 'Accept': 'application/json',
// 'Content-Type': 'application/json',
// },
// credentials: 'include',
// body: JSON.stringify(request),
// })
// .then(res => res.json().then(data => ({ status: <number>res.status, body: <EndpointResponse>data })))
// .then((fullResponse) => {
// let maybeError = maybeMapError(fullResponse);
// if (maybeError !== undefined) {
// return { error: maybeError };
// }
// if (!fullResponse.body || !fullResponse.body.success) {
// return { error: GenerateTtsAudioErrorType.UnknownError };
// }
// if (!('inference_job_token' in fullResponse.body)) {
// return { error: GenerateTtsAudioErrorType.UnknownError };
// } else {
// return <GenerateTtsAudioSuccess> {
// inference_job_token: fullResponse.body.inference_job_token,
// inference_job_token_type: fullResponse.body.inference_job_token_type,
// };
// }
// })
// .catch(e => {
// let maybeError = maybeMapError(e);
// if (maybeError !== undefined) {
// return { error: maybeError };
// }
// return { error: GenerateTtsAudioErrorType.UnknownError };
// });
};