Workaround because of search bug in relationshipfields
This commit is contained in:
parent
87a2ca1bc3
commit
0890d0c3f8
|
@ -25,7 +25,7 @@ const fields = {
|
|||
export const Audios = buildCollectionConfig({
|
||||
slug: Collections.Audios,
|
||||
labels: { singular: "Audio", plural: "Audios" },
|
||||
defaultSort: fields.updatedAt,
|
||||
defaultSort: fields.filename,
|
||||
admin: {
|
||||
group: CollectionGroups.Media,
|
||||
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/audios/${id}`,
|
||||
|
|
|
@ -34,7 +34,7 @@ const fields = {
|
|||
export const Videos = buildCollectionConfig({
|
||||
slug: Collections.Videos,
|
||||
labels: { singular: "Video", plural: "Videos" },
|
||||
defaultSort: fields.updatedAt,
|
||||
defaultSort: fields.filename,
|
||||
admin: {
|
||||
group: CollectionGroups.Media,
|
||||
preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/videos/${id}`,
|
||||
|
|
|
@ -4,6 +4,10 @@ import { publicAccess } from "../accesses/publicAccess";
|
|||
import { CollectionGroups } from "../constants";
|
||||
import { BuildCollectionConfig, buildCollectionConfig } from "./collectionConfig";
|
||||
|
||||
const fields = {
|
||||
filename: "filename",
|
||||
};
|
||||
|
||||
type BuildImageCollectionConfig = Omit<BuildCollectionConfig, "upload"> & {
|
||||
upload: { imageSizes: ImageSize[] };
|
||||
};
|
||||
|
@ -15,10 +19,10 @@ export const buildImageCollectionConfig = ({
|
|||
}: BuildImageCollectionConfig): CollectionConfig =>
|
||||
buildCollectionConfig({
|
||||
...otherConfig,
|
||||
defaultSort: "-updatedAt",
|
||||
defaultSort: fields.filename,
|
||||
admin: {
|
||||
disableDuplicate: true,
|
||||
useAsTitle: "filename",
|
||||
useAsTitle: fields.filename,
|
||||
group: CollectionGroups.Media,
|
||||
...admin,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue