Removed some of the calls to process.env; Used server props instead
This commit is contained in:
parent
376220b26e
commit
f51f36a411
5 changed files with 52 additions and 11 deletions
|
@ -9,10 +9,12 @@ const DeleteChat = ({
|
|||
chatId,
|
||||
chats,
|
||||
setChats,
|
||||
backendApiUrl
|
||||
}: {
|
||||
chatId: string;
|
||||
chats: Chat[];
|
||||
setChats: (chats: Chat[]) => void;
|
||||
backendApiUrl: string
|
||||
}) => {
|
||||
const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
@ -21,7 +23,7 @@ const DeleteChat = ({
|
|||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${process.env.BACKEND_API_URL}/chats/${chatId}`,
|
||||
`${backendApiUrl}/chats/${chatId}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue