File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
packages/plugin-multi-tenant/src Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const fieldValidation =
3232
3333type Args = {
3434 debug ?: boolean
35- isDraftsEnabled ?: boolean
35+ isAutosaveEnabled ?: boolean
3636 name : string
3737 overrides ?: RootTenantFieldConfigOverrides
3838 tenantsArrayFieldName : string
@@ -43,7 +43,7 @@ type Args = {
4343export const tenantField = ( {
4444 name = defaults . tenantFieldName ,
4545 debug,
46- isDraftsEnabled ,
46+ isAutosaveEnabled ,
4747 overrides : _overrides = { } ,
4848 tenantsArrayFieldName = defaults . tenantsArrayFieldName ,
4949 tenantsArrayTenantFieldName = defaults . tenantsArrayTenantFieldName ,
@@ -104,7 +104,7 @@ export const tenantField = ({
104104 } )
105105 return isValidTenant ? tenantFromCookie : null
106106 }
107- if ( req . user && isDraftsEnabled ) {
107+ if ( req . user && isAutosaveEnabled ) {
108108 const userTenants = getUserTenantIDs ( req . user , {
109109 tenantsArrayFieldName,
110110 tenantsArrayTenantFieldName,
Original file line number Diff line number Diff line change @@ -190,10 +190,11 @@ export const multiTenantPlugin =
190190 tenantField ( {
191191 name : tenantFieldName ,
192192 debug : pluginConfig . debug ,
193- isDraftsEnabled : Boolean (
193+ isAutosaveEnabled : Boolean (
194194 collection . versions &&
195195 typeof collection . versions === 'object' &&
196- collection . versions . drafts ,
196+ typeof collection . versions . drafts === 'object' &&
197+ Boolean ( collection . versions . drafts . autosave ) ,
197198 ) ,
198199 overrides : pluginConfig . collections [ collection . slug ] ?. tenantFieldOverrides
199200 ? pluginConfig . collections [ collection . slug ] ?. tenantFieldOverrides
@@ -381,10 +382,11 @@ export const multiTenantPlugin =
381382 tenantField ( {
382383 name : tenantFieldName ,
383384 debug : pluginConfig . debug ,
384- isDraftsEnabled : Boolean (
385+ isAutosaveEnabled : Boolean (
385386 collection . versions &&
386387 typeof collection . versions === 'object' &&
387- collection . versions . drafts ,
388+ typeof collection . versions . drafts === 'object' &&
389+ Boolean ( collection . versions . drafts . autosave ) ,
388390 ) ,
389391 overrides : pluginConfig . collections [ collection . slug ] ?. tenantFieldOverrides
390392 ? pluginConfig . collections [ collection . slug ] ?. tenantFieldOverrides
You can’t perform that action at this time.
0 commit comments