Add awaits
This commit is contained in:
parent
f11180db7a
commit
631a5e3e31
8 changed files with 14 additions and 13 deletions
|
|
@ -40,7 +40,7 @@ const useSocket = (
|
|||
);
|
||||
|
||||
const providers = await fetch(
|
||||
`${getServerEnv("BACKEND_API_URL")}/models`,
|
||||
`${await getServerEnv("BACKEND_API_URL")}/models`,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
@ -221,7 +221,7 @@ const loadMessages = async (
|
|||
setNotFound: (notFound: boolean) => void,
|
||||
) => {
|
||||
const res = await fetch(
|
||||
`${getServerEnv("BACKEND_API_URL")}/chats/${chatId}`,
|
||||
`${await getServerEnv("BACKEND_API_URL")}/chats/${chatId}`,
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const DeleteChat = ({
|
|||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${getServerEnv("BACKEND_API_URL")}/chats/${chatId}`,
|
||||
`${await getServerEnv("BACKEND_API_URL")}/chats/${chatId}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const SearchImages = ({
|
|||
const chatModel = localStorage.getItem('chatModel');
|
||||
|
||||
const res = await fetch(
|
||||
`${getServerEnv("BACKEND_API_URL")}/images`,
|
||||
`${await getServerEnv("BACKEND_API_URL")}/images`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ const Searchvideos = ({
|
|||
const chatModel = localStorage.getItem('chatModel');
|
||||
|
||||
const res = await fetch(
|
||||
`${getServerEnv("BACKEND_API_URL")}/videos`,
|
||||
`${await getServerEnv("BACKEND_API_URL")}/videos`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ const SettingsDialog = ({
|
|||
if (isOpen) {
|
||||
const fetchConfig = async () => {
|
||||
setIsLoading(true);
|
||||
const res = await fetch(`${getServerEnv("BACKEND_API_URL")}/config`, {
|
||||
const res = await fetch(`${await getServerEnv("BACKEND_API_URL")}/config`, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
|
|
@ -149,7 +149,7 @@ const SettingsDialog = ({
|
|||
setIsUpdating(true);
|
||||
|
||||
try {
|
||||
await fetch(`${getServerEnv("BACKEND_API_URL")}/config`, {
|
||||
await fetch(`${await getServerEnv("BACKEND_API_URL")}/config`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue