Added background images collection
This commit is contained in:
parent
f007560f4d
commit
7b97bd77c1
|
@ -0,0 +1,23 @@
|
|||
import { Collections } from "../../constants";
|
||||
import { buildImageCollectionConfig } from "../../utils/imageCollectionConfig";
|
||||
|
||||
const fields = {
|
||||
filename: "filename",
|
||||
mimeType: "mimeType",
|
||||
filesize: "filesize",
|
||||
posts: "posts",
|
||||
updatedAt: "updatedAt",
|
||||
} as const satisfies Record<string, string>;
|
||||
|
||||
export const BackgroundImages = buildImageCollectionConfig({
|
||||
slug: Collections.BackgroundImages,
|
||||
labels: {
|
||||
singular: "Background Image",
|
||||
plural: "Background Images",
|
||||
},
|
||||
admin: { defaultColumns: [fields.filename, fields.posts, fields.updatedAt] },
|
||||
upload: {
|
||||
imageSizes: [],
|
||||
},
|
||||
fields: [],
|
||||
});
|
|
@ -201,7 +201,7 @@ export const Collectibles = buildVersionedCollectionConfig({
|
|||
fields: [
|
||||
imageField({
|
||||
name: fields.backgroundImage,
|
||||
relationTo: Collections.Images,
|
||||
relationTo: Collections.BackgroundImages,
|
||||
admin: {
|
||||
description:
|
||||
"The image used as background from the webpage.\
|
||||
|
|
|
@ -92,7 +92,7 @@ export const Pages = buildVersionedCollectionConfig({
|
|||
}),
|
||||
imageField({
|
||||
name: fields.backgroundImage,
|
||||
relationTo: Collections.Images,
|
||||
relationTo: Collections.BackgroundImages,
|
||||
admin: {
|
||||
description:
|
||||
"The image used as background from the webpage.\
|
||||
|
|
|
@ -32,6 +32,7 @@ export enum Collections {
|
|||
Wordings = "wordings",
|
||||
Collectibles = "collectibles",
|
||||
GenericContents = "generic-contents",
|
||||
BackgroundImages = "background-images",
|
||||
}
|
||||
|
||||
export enum CollectionGroups {
|
||||
|
|
|
@ -2,6 +2,7 @@ import { webpackBundler } from "@payloadcms/bundler-webpack";
|
|||
import { mongooseAdapter } from "@payloadcms/db-mongodb";
|
||||
import path from "path";
|
||||
import { buildConfig } from "payload/config";
|
||||
import { BackgroundImages } from "./collections/BackgroundImages/BackgroundImages";
|
||||
import { ChronologyEras } from "./collections/ChronologyEras/ChronologyEras";
|
||||
import { ChronologyItems } from "./collections/ChronologyItems/ChronologyItems";
|
||||
import { Collectibles } from "./collections/Collectibles/Collectibles";
|
||||
|
@ -64,6 +65,7 @@ export default buildConfig({
|
|||
Wordings,
|
||||
Collectibles,
|
||||
GenericContents,
|
||||
BackgroundImages,
|
||||
],
|
||||
db: mongooseAdapter({
|
||||
url: process.env.MONGODB_URI ?? "mongodb://mongo:27017/payload",
|
||||
|
|
Loading…
Reference in New Issue