mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Improve consistency
This commit is contained in:
@@ -56,12 +56,12 @@ export const useCollectionsStore = createStore({
|
||||
this.reset();
|
||||
},
|
||||
async updateCollection(collection: string, updates: Partial<Collection>) {
|
||||
const notify = useNotificationsStore();
|
||||
const notificationsStore = useNotificationsStore();
|
||||
|
||||
try {
|
||||
await api.patch(`/collections/${collection}`, updates);
|
||||
await this.hydrate();
|
||||
notify.add({
|
||||
notificationsStore.add({
|
||||
type: 'success',
|
||||
title: i18n.t('update_collection_success'),
|
||||
});
|
||||
@@ -70,11 +70,11 @@ export const useCollectionsStore = createStore({
|
||||
}
|
||||
},
|
||||
async deleteCollection(collection: string) {
|
||||
const notify = useNotificationsStore();
|
||||
const notificationsStore = useNotificationsStore();
|
||||
try {
|
||||
await api.delete(`/collections/${collection}`);
|
||||
await this.hydrate();
|
||||
notify.add({
|
||||
notificationsStore.add({
|
||||
type: 'success',
|
||||
title: i18n.t('delete_collection_success'),
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ export const useSettingsStore = createStore({
|
||||
},
|
||||
|
||||
async updateSettings(updates: { [key: string]: any }) {
|
||||
const notify = useNotificationsStore();
|
||||
const notificationsStore = useNotificationsStore();
|
||||
const settingsCopy = { ...this.state.settings };
|
||||
const newSettings = merge({}, this.state.settings, updates);
|
||||
|
||||
@@ -35,7 +35,7 @@ export const useSettingsStore = createStore({
|
||||
|
||||
this.state.settings = response.data.data;
|
||||
|
||||
notify.add({
|
||||
notificationsStore.add({
|
||||
title: i18n.t('settings_update_success'),
|
||||
type: 'success',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user