feat: Implement Default Preset Selection for Conversations 📌 (#1275)

* fix: type issues with icons

* refactor: use react query for presets, show toasts on preset crud, refactor mutations, remove presetsQuery from Root (breaking change)

* refactor: change preset titling

* refactor: update preset schemas and methods for necessary new properties `order` and `defaultPreset`

* feat: add `defaultPreset` Recoil value

* refactor(getPresetTitle): make logic cleaner and more concise

* feat: complete UI portion of defaultPreset feature, with animations added to preset items

* chore: remove console.logs()

* feat: complete default preset handling

* refactor: remove user sensitive values on logout

* fix: allow endpoint selection without default preset overwriting
This commit is contained in:
Danny Avila 2023-12-06 14:00:15 -05:00 committed by GitHub
parent fdb65366d7
commit ca64efec1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 681 additions and 270 deletions

View file

@ -1,4 +1,5 @@
import * as f from './types/files';
import * as p from './types/presets';
import * as a from './types/assistants';
import * as t from './types';
import * as s from './schemas';
@ -73,15 +74,15 @@ export function getPresets(): Promise<s.TPreset[]> {
return request.get(endpoints.presets());
}
export function createPreset(payload: s.TPreset): Promise<s.TPreset[]> {
export function createPreset(payload: s.TPreset): Promise<s.TPreset> {
return request.post(endpoints.presets(), payload);
}
export function updatePreset(payload: s.TPreset): Promise<s.TPreset[]> {
export function updatePreset(payload: s.TPreset): Promise<s.TPreset> {
return request.post(endpoints.presets(), payload);
}
export function deletePreset(arg: s.TPreset | object): Promise<s.TPreset[]> {
export function deletePreset(arg: s.TPreset | undefined): Promise<p.PresetDeleteResponse> {
return request.post(endpoints.deletePreset(), arg);
}