mirror of
https://github.com/directus/directus.git
synced 2026-01-24 08:58:11 -05:00
Make generated junction table hidden by default
This commit is contained in:
@@ -73,8 +73,10 @@ export default class CollectionsService {
|
||||
}
|
||||
});
|
||||
|
||||
const collectionInfo = omit(payload, 'fields');
|
||||
await collectionItemsService.create(collectionInfo);
|
||||
await collectionItemsService.create({
|
||||
...(payload.meta || {}),
|
||||
collection: payload.collection,
|
||||
});
|
||||
|
||||
const fieldPayloads = payload
|
||||
.fields!.filter((field) => field.meta)
|
||||
|
||||
@@ -220,8 +220,6 @@ export default defineComponent({
|
||||
async function saveField() {
|
||||
saving.value = true;
|
||||
|
||||
console.log(state);
|
||||
|
||||
try {
|
||||
if (props.field !== '+') {
|
||||
await api.patch(`/fields/${props.collection}/${props.field}`, state.fieldData);
|
||||
|
||||
@@ -326,6 +326,9 @@ function initLocalStore(
|
||||
state.newCollections.push({
|
||||
$type: 'junction',
|
||||
collection: junctionCollection,
|
||||
meta: {
|
||||
hidden: true,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
field: 'id',
|
||||
@@ -470,6 +473,7 @@ function initLocalStore(
|
||||
stop = watch([() => state.relations[1].one_collection, () => state.relations[1].one_primary], ([newRelatedCollection, newRelatedPrimary]: string[]) => {
|
||||
if (newRelatedCollection) {
|
||||
state.relations[0].many_collection = `${state.relations[0].one_collection}_${state.relations[1].one_collection}`;
|
||||
state.relations[1].many_collection = `${state.relations[0].one_collection}_${state.relations[1].one_collection}`;
|
||||
state.relations[0].many_field = `${state.relations[0].one_collection}_${state.relations[0].one_primary}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user