mirror of
https://github.com/strapi/strapi.git
synced 2025-09-01 12:53:03 +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;
|
headerId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log({ allDataSchema });
|
||||||
|
|
||||||
const checkFormValidity = async () => {
|
const checkFormValidity = async () => {
|
||||||
let schema;
|
let schema;
|
||||||
|
|
||||||
if (state.modalType === 'contentType') {
|
if (state.modalType === 'contentType') {
|
||||||
schema = forms[state.modalType].schema(Object.keys(contentTypes));
|
schema = forms[state.modalType].schema(Object.keys(contentTypes));
|
||||||
} else if (
|
} else if (
|
||||||
state.modalType === 'attribute' &&
|
state.modalType === 'attribute'
|
||||||
state.forTarget !== 'components' &&
|
// && state.forTarget !== 'components' &&
|
||||||
state.forTarget !== 'component'
|
// state.forTarget !== 'component'
|
||||||
) {
|
) {
|
||||||
|
const pathToSchemaAttributes =
|
||||||
|
state.forTarget === 'contentType' || state.forTarget === 'component'
|
||||||
|
? [state.forTarget]
|
||||||
|
: [state.forTarget, state.targetUid];
|
||||||
|
|
||||||
schema = forms[state.modalType].schema(
|
schema = forms[state.modalType].schema(
|
||||||
allDataSchema,
|
get(allDataSchema, pathToSchemaAttributes, {}),
|
||||||
modifiedData.type,
|
modifiedData.type,
|
||||||
modifiedData
|
modifiedData
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user