mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
fix create relation after collection deletion (#9392)
This commit is contained in:
@@ -10,7 +10,7 @@ import formatTitle from '@directus/format-title';
|
||||
import { defineStore } from 'pinia';
|
||||
import { COLLECTIONS_DENY_LIST } from '@/constants';
|
||||
import { isEqual, orderBy, omit } from 'lodash';
|
||||
import { useFieldsStore } from '.';
|
||||
import { useFieldsStore, useRelationsStore } from '.';
|
||||
|
||||
export const useCollectionsStore = defineStore({
|
||||
id: 'collectionsStore',
|
||||
@@ -139,9 +139,12 @@ export const useCollectionsStore = defineStore({
|
||||
}
|
||||
},
|
||||
async deleteCollection(collection: string) {
|
||||
const relationsStore = useRelationsStore();
|
||||
|
||||
try {
|
||||
await api.delete(`/collections/${collection}`);
|
||||
await this.hydrate();
|
||||
await relationsStore.hydrate();
|
||||
notify({
|
||||
type: 'success',
|
||||
title: i18n.global.t('delete_collection_success'),
|
||||
|
||||
Reference in New Issue
Block a user