mirror of
https://github.com/directus/directus.git
synced 2026-01-26 16:18:18 -05:00
Fix create M2M field concurrency (#9220)
* fix create m2m field concurrency * remove unused import * Re-add missing store Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -173,6 +173,8 @@ export const useFieldDetailStore = defineStore({
|
||||
for (const collection of Object.keys(this.items)) {
|
||||
await api.post(`/items/${collection}`, this.items[collection]);
|
||||
}
|
||||
|
||||
await fieldsStore.hydrate();
|
||||
} catch (err: any) {
|
||||
unexpectedError(err);
|
||||
} finally {
|
||||
|
||||
@@ -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, useRelationsStore } from '.';
|
||||
import { useRelationsStore } from './relations';
|
||||
|
||||
export const useCollectionsStore = defineStore({
|
||||
id: 'collectionsStore',
|
||||
@@ -93,7 +93,6 @@ export const useCollectionsStore = defineStore({
|
||||
});
|
||||
},
|
||||
async upsertCollection(collection: string, values: DeepPartial<Collection & { fields: Field[] }>) {
|
||||
const fieldsStore = useFieldsStore();
|
||||
const existing = this.getCollection(collection);
|
||||
|
||||
// Strip out any fields the app might've auto-generated at some point
|
||||
@@ -122,8 +121,6 @@ export const useCollectionsStore = defineStore({
|
||||
}
|
||||
} catch (err: any) {
|
||||
unexpectedError(err);
|
||||
} finally {
|
||||
await fieldsStore.hydrate();
|
||||
}
|
||||
},
|
||||
async updateCollection(collection: string, updates: DeepPartial<Collection>) {
|
||||
|
||||
Reference in New Issue
Block a user