File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/next/src/views/Version/Restore Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,14 @@ const Restore: React.FC<Props> = ({
36
36
} ) => {
37
37
const {
38
38
config : {
39
+ collections,
39
40
routes : { admin : adminRoute , api : apiRoute } ,
40
41
serverURL,
41
42
} ,
42
43
} = useConfig ( )
43
44
45
+ const collectionConfig = collections . find ( ( collection ) => collection . slug === collectionSlug )
46
+
44
47
const { toggleModal } = useModal ( )
45
48
const [ processing , setProcessing ] = useState ( false )
46
49
const router = useRouter ( )
@@ -54,7 +57,8 @@ const Restore: React.FC<Props> = ({
54
57
55
58
let fetchURL = `${ serverURL } ${ apiRoute } `
56
59
let redirectURL : string
57
- const canRestoreAsDraft = status !== 'draft'
60
+
61
+ const canRestoreAsDraft = status !== 'draft' && collectionConfig ?. versions ?. drafts
58
62
59
63
if ( collectionSlug ) {
60
64
fetchURL = `${ fetchURL } /${ collectionSlug } /versions/${ versionID } ?draft=${ draft } `
You can’t perform that action at this time.
0 commit comments