mirror of
https://github.com/strapi/strapi.git
synced 2025-08-31 04:03:50 +00:00
Fix validations for allready taken attributes
This commit is contained in:
parent
9237f6cf9d
commit
c29212aa2c
@ -1,17 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<Loader /> should not crash 1`] = `
|
||||
<div
|
||||
className="sc-fYxtnH jGsbTZ"
|
||||
>
|
||||
<div
|
||||
className="centered"
|
||||
>
|
||||
<div
|
||||
className="sc-fMiknA iIEoBL"
|
||||
>
|
||||
<div />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
@ -122,18 +122,25 @@ const FormModal = () => {
|
||||
headerId = null;
|
||||
}
|
||||
|
||||
console.log({ allDataSchema });
|
||||
|
||||
const checkFormValidity = async () => {
|
||||
let schema;
|
||||
|
||||
if (state.modalType === 'contentType') {
|
||||
schema = forms[state.modalType].schema(Object.keys(contentTypes));
|
||||
} else if (
|
||||
state.modalType === 'attribute' &&
|
||||
state.forTarget !== 'components' &&
|
||||
state.forTarget !== 'component'
|
||||
state.modalType === 'attribute'
|
||||
// && state.forTarget !== 'components' &&
|
||||
// state.forTarget !== 'component'
|
||||
) {
|
||||
const pathToSchemaAttributes =
|
||||
state.forTarget === 'contentType' || state.forTarget === 'component'
|
||||
? [state.forTarget]
|
||||
: [state.forTarget, state.targetUid];
|
||||
|
||||
schema = forms[state.modalType].schema(
|
||||
allDataSchema,
|
||||
get(allDataSchema, pathToSchemaAttributes, {}),
|
||||
modifiedData.type,
|
||||
modifiedData
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user