diff --git a/packages/next/src/views/Version/Restore/index.tsx b/packages/next/src/views/Version/Restore/index.tsx index f9a9c95ab01..8ba861bc4db 100644 --- a/packages/next/src/views/Version/Restore/index.tsx +++ b/packages/next/src/views/Version/Restore/index.tsx @@ -36,11 +36,14 @@ const Restore: React.FC = ({ }) => { const { config: { + collections, routes: { admin: adminRoute, api: apiRoute }, serverURL, }, } = useConfig() + const collectionConfig = collections.find((collection) => collection.slug === collectionSlug) + const { toggleModal } = useModal() const [processing, setProcessing] = useState(false) const router = useRouter() @@ -54,7 +57,8 @@ const Restore: React.FC = ({ let fetchURL = `${serverURL}${apiRoute}` let redirectURL: string - const canRestoreAsDraft = status !== 'draft' + + const canRestoreAsDraft = status !== 'draft' && collectionConfig?.versions?.drafts if (collectionSlug) { fetchURL = `${fetchURL}/${collectionSlug}/versions/${versionID}?draft=${draft}`