mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
- add global () with required media upload field - register new global in and include it in admin live preview - replace hardcoded frontend landing content with CMS-driven homepage image - add typed cached utilities for globals/documents + centralized revalidation helpers - migrate components to new global utility module and remove deprecated helper - update revalidation hook to use shared global revalidation - refine frontend layout/header and simplify legacy homepage CSS - regenerate for new global/schema changes
30 lines
567 B
TypeScript
30 lines
567 B
TypeScript
import { revalidateGlobal } from '@/utilities/globals'
|
|
import { GlobalConfig } from 'payload'
|
|
|
|
const slug = 'home'
|
|
|
|
const revalidate = async () => revalidateGlobal(slug)
|
|
|
|
export const HomePage: GlobalConfig = {
|
|
slug,
|
|
label: 'Pagina Inicial',
|
|
admin: {
|
|
group: 'Paginas',
|
|
},
|
|
access: {
|
|
read: () => true,
|
|
update: ({ req: { user } }) => Boolean(user),
|
|
},
|
|
hooks: {
|
|
afterChange: [revalidate],
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'image',
|
|
type: 'upload',
|
|
label: 'Imagem',
|
|
relationTo: 'media',
|
|
required: true,
|
|
},
|
|
],
|
|
}
|