mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 19:00:13 +01:00
feat: add preset and edit preset.
This commit is contained in:
parent
80ef5008dd
commit
45e17da241
29 changed files with 592 additions and 493 deletions
|
|
@ -39,6 +39,7 @@ const App = () => {
|
|||
const [user, setUser] = useRecoilState(store.user);
|
||||
const setIsSearchEnabled = useSetRecoilState(store.isSearchEnabled);
|
||||
const setEndpointsConfig = useSetRecoilState(store.endpointsConfig);
|
||||
const setPresets = useSetRecoilState(store.presets);
|
||||
|
||||
useEffect(() => {
|
||||
// fetch if seatch enabled
|
||||
|
|
@ -70,6 +71,21 @@ const App = () => {
|
|||
console.log('Not login!');
|
||||
window.location.href = '/auth/login';
|
||||
});
|
||||
|
||||
// fetch presets
|
||||
axios
|
||||
.get('/api/presets', {
|
||||
timeout: 1000,
|
||||
withCredentials: true
|
||||
})
|
||||
.then(({ data }) => {
|
||||
setPresets(data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
console.log('Not login!');
|
||||
window.location.href = '/auth/login';
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue