Skip to content

Commit bd80784

Browse files
chore(plugin-multi-tenant): removes basePath arg (#15202)
The `basePath` property was previously added as a bandaid fix, but now that payload has a better handle on this internally we no longer need it. The basePath variable is set on process.env.NEXT_BASE_PATH and this plugin uses the `formatAdminURL()` which looks for it internally. There is no reason you need to set basePath specifically on this plugin config.
1 parent 85d5263 commit bd80784

File tree

4 files changed

+0
-13
lines changed

4 files changed

+0
-13
lines changed

packages/plugin-multi-tenant/src/components/GlobalViewRedirect/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type { MultiTenantPluginConfig } from '../../types.js'
88
import { getGlobalViewRedirect } from '../../utilities/getGlobalViewRedirect.js'
99

1010
type Args = {
11-
basePath?: string
1211
collectionSlug: CollectionSlug
1312
docID?: number | string
1413
globalSlugs: string[]
@@ -27,7 +26,6 @@ export const GlobalViewRedirect = async (args: Args) => {
2726
const headers = await getHeaders()
2827
const redirectRoute = await getGlobalViewRedirect({
2928
slug: collectionSlug,
30-
basePath: args.basePath,
3129
docID: args.docID,
3230
headers,
3331
payload: args.payload,

packages/plugin-multi-tenant/src/defaults.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const defaults = {
2-
basePath: undefined,
32
tenantCollectionSlug: 'tenants',
43
tenantFieldName: 'tenant',
54
tenantsArrayFieldName: 'tenants',

packages/plugin-multi-tenant/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const multiTenantPlugin =
4242
pluginConfig?.tenantsArrayField?.arrayFieldName || defaults.tenantsArrayFieldName
4343
const tenantsArrayTenantFieldName =
4444
pluginConfig?.tenantsArrayField?.arrayTenantFieldName || defaults.tenantsArrayTenantFieldName
45-
const basePath = pluginConfig.basePath || defaults.basePath
4645

4746
/**
4847
* Add defaults for admin properties
@@ -469,7 +468,6 @@ export const multiTenantPlugin =
469468
incomingConfig.admin.components.actions.push({
470469
path: '@payloadcms/plugin-multi-tenant/rsc#GlobalViewRedirect',
471470
serverProps: {
472-
basePath,
473471
globalSlugs: globalCollectionSlugs,
474472
tenantFieldName,
475473
tenantsArrayFieldName,

packages/plugin-multi-tenant/src/types.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ import type {
1212
} from 'payload'
1313

1414
export type MultiTenantPluginConfig<ConfigTypes = unknown> = {
15-
/**
16-
* Base path for your application
17-
*
18-
* https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath
19-
*
20-
* @default undefined
21-
*/
22-
basePath?: string
2315
/**
2416
* After a tenant is deleted, the plugin will attempt to clean up related documents
2517
* - removing documents with the tenant ID

0 commit comments

Comments
 (0)