fix: make sure schemaPath of Edit View updates when switching collections
This commit is contained in:
@@ -67,7 +67,7 @@ export const DefaultEditView: React.FC = () => {
|
||||
|
||||
const globalConfig = globalSlug && globals.find((global) => global.slug === globalSlug)
|
||||
|
||||
const [schemaPath] = React.useState(collectionConfig?.slug || globalConfig?.slug)
|
||||
const schemaPath = collectionConfig?.slug || globalConfig?.slug
|
||||
|
||||
const fieldMap = getFieldMap({
|
||||
collectionSlug: collectionConfig?.slug,
|
||||
|
||||
@@ -34,8 +34,8 @@ export const EditViewClient: React.FC<EditViewProps> = () => {
|
||||
|
||||
const onSave = useCallback(
|
||||
async (json: { doc }) => {
|
||||
getVersions()
|
||||
getDocPermissions()
|
||||
void getVersions()
|
||||
void getDocPermissions()
|
||||
|
||||
if (!isEditing) {
|
||||
router.push(`${adminRoute}/collections/${collectionSlug}/${json?.doc?.id}`)
|
||||
|
||||
@@ -556,7 +556,7 @@ const Form: React.FC<Props> = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
executeOnChange() // eslint-disable-line @typescript-eslint/no-floating-promises
|
||||
void executeOnChange() // eslint-disable-line @typescript-eslint/no-floating-promises
|
||||
},
|
||||
150,
|
||||
[fields, dispatchFields, onChange],
|
||||
|
||||
Reference in New Issue
Block a user