mirror of
https://github.com/directus/directus.git
synced 2026-02-12 04:34:56 -05:00
allow for temporary presets (#4724)
This commit is contained in:
@@ -5,7 +5,7 @@ import { useCollection } from '@/composables/use-collection';
|
||||
|
||||
import { Filter, Preset } from '@/types/';
|
||||
|
||||
export function usePreset(collection: Ref<string>, bookmark: Ref<number | null> = ref(null)) {
|
||||
export function usePreset(collection: Ref<string>, bookmark: Ref<number | null> = ref(null), temporary = false) {
|
||||
const presetsStore = usePresetsStore();
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -29,6 +29,7 @@ export function usePreset(collection: Ref<string>, bookmark: Ref<number | null>
|
||||
* @param preset The preset that should be saved
|
||||
*/
|
||||
const savePreset = async (preset?: Partial<Preset>) => {
|
||||
if (temporary) return;
|
||||
busy.value = true;
|
||||
|
||||
const updatedValues = await presetsStore.savePreset(preset ? preset : localPreset.value);
|
||||
|
||||
Reference in New Issue
Block a user