mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Update bookmark editing flow
This commit is contained in:
@@ -22,7 +22,6 @@ export const usePresetsStore = createStore({
|
||||
actions: {
|
||||
async hydrate() {
|
||||
// Hydrate is only called for logged in users, therefore, currentUser exists
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const { id, role } = useUserStore().state.currentUser!;
|
||||
|
||||
const values = await Promise.all([
|
||||
@@ -65,6 +64,7 @@ export const usePresetsStore = createStore({
|
||||
|
||||
this.state.collectionPresets = this.state.collectionPresets.map((preset) => {
|
||||
const updatedPreset = response.data.data;
|
||||
|
||||
if (preset.id === updatedPreset.id) {
|
||||
return updatedPreset;
|
||||
}
|
||||
@@ -167,5 +167,18 @@ export const usePresetsStore = createStore({
|
||||
return await this.update(id, preset);
|
||||
}
|
||||
},
|
||||
|
||||
async saveLocal(updatedPreset: Preset) {
|
||||
this.state.collectionPresets = this.state.collectionPresets.map((preset) => {
|
||||
if (preset.id === updatedPreset.id) {
|
||||
return {
|
||||
...updatedPreset,
|
||||
$saved: false,
|
||||
};
|
||||
}
|
||||
|
||||
return preset;
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user