mirror of
https://github.com/StanGirard/quivr.git
synced 2024-09-11 13:15:41 +03:00
fix: linting on build
This commit is contained in:
parent
ec304e9272
commit
0bc4221b2c
@ -17,7 +17,7 @@ export const ApiKeyConfig = (): JSX.Element => {
|
||||
}
|
||||
};
|
||||
|
||||
const copyToClipboard = async (text) => {
|
||||
const copyToClipboard = async (text: string) => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
} catch (err) {
|
||||
|
@ -34,24 +34,27 @@ export default function useChats() {
|
||||
text: "Error occured while fetching your chats",
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
}, [axiosInstance, publish]);
|
||||
|
||||
const fetchChat = useCallback(async (chatId?: UUID) => {
|
||||
if (!chatId) return;
|
||||
try {
|
||||
console.log(`Fetching chat ${chatId}`);
|
||||
const response = await axiosInstance.get<Chat>(`/chat/${chatId}`);
|
||||
console.log(response.data);
|
||||
const fetchChat = useCallback(
|
||||
async (chatId?: UUID) => {
|
||||
if (!chatId) return;
|
||||
try {
|
||||
console.log(`Fetching chat ${chatId}`);
|
||||
const response = await axiosInstance.get<Chat>(`/chat/${chatId}`);
|
||||
console.log(response.data);
|
||||
|
||||
setChat(response.data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
publish({
|
||||
variant: "danger",
|
||||
text: `Error occured while fetching ${chatId}`,
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
setChat(response.data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
publish({
|
||||
variant: "danger",
|
||||
text: `Error occured while fetching ${chatId}`,
|
||||
});
|
||||
}
|
||||
},
|
||||
[axiosInstance, publish]
|
||||
);
|
||||
|
||||
type ChatResponse = Omit<Chat, "chatId"> & { chatId: UUID | undefined };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user