fix: syntax issues
This commit is contained in:
@@ -13,7 +13,7 @@ import { Tags } from './collections/Tags';
|
||||
import { Editions } from './collections/Editions';
|
||||
import { Subscribers } from './collections/Subscribers';
|
||||
|
||||
import { revalidateAstro } from './hooks/revalidateAstro';
|
||||
import { withRevalidate } from './lib/withRevalidate';
|
||||
|
||||
const filename = fileURLToPath(import.meta.url);
|
||||
const dirname = path.dirname(filename);
|
||||
@@ -23,6 +23,13 @@ const corsOrigins = (process.env.CORS_ORIGINS || '')
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
// Wrap each publishing collection so a save fires the Astro rebuild webhook.
|
||||
const articles = withRevalidate(Articles);
|
||||
const authors = withRevalidate(Authors);
|
||||
const categories = withRevalidate(Categories);
|
||||
const tags = withRevalidate(Tags);
|
||||
const editions = withRevalidate(Editions);
|
||||
|
||||
export default buildConfig({
|
||||
serverURL: process.env.SERVER_URL,
|
||||
cors: corsOrigins,
|
||||
@@ -34,7 +41,7 @@ export default buildConfig({
|
||||
titleSuffix: ' · SoftVowels CMS',
|
||||
},
|
||||
},
|
||||
collections: [Users, Media, Articles, Authors, Categories, Tags, Editions, Subscribers],
|
||||
collections: [Users, Media, articles, authors, categories, tags, editions, Subscribers],
|
||||
editor: lexicalEditor(),
|
||||
secret: process.env.PAYLOAD_SECRET || 'dev-secret-change-me',
|
||||
typescript: {
|
||||
@@ -45,7 +52,6 @@ export default buildConfig({
|
||||
connectionString: process.env.DATABASE_URI || '',
|
||||
},
|
||||
}),
|
||||
sharp: (sharp) => sharp,
|
||||
upload: {
|
||||
limits: {
|
||||
fileSize: 25_000_000,
|
||||
@@ -53,6 +59,10 @@ export default buildConfig({
|
||||
},
|
||||
endpoints: [],
|
||||
hooks: {
|
||||
afterChange: [revalidateAstro],
|
||||
afterError: [
|
||||
async (err) => {
|
||||
console.error('[payload] afterError', err.error);
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user