Previously, collections with similar names (e.g., `uploads` and `uploads-poly`) both appeared active when viewing either collection. This was due to `pathname.startsWith(href)`, which caused partial matches. This update refines the `isActive` logic to prevent partial matches.
15 lines
281 B
TypeScript
15 lines
281 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
import { uploadTwoCollectionSlug } from '../slugs.js'
|
|
|
|
export const UploadTwoCollection: CollectionConfig = {
|
|
slug: uploadTwoCollectionSlug,
|
|
fields: [
|
|
{
|
|
name: 'title',
|
|
type: 'text',
|
|
},
|
|
],
|
|
upload: true,
|
|
}
|