Overwrite Save

default discord avatar
agolovan
3 months ago
6

Is that already released? const Config = {


admin: {


components: {


// changed

elements

to

edit

// to better scope custom components


edit: {


SaveButton: CustomSaveButton,


SaveDraftButton: CustomSaveDraftButton,


PublishButton: CustomPublishButton,


PreviewButton: CustomPreviewButton,


},



I am using custom field and would like to overwrite or add additional code on Save.

  • default discord avatar
    jarrod69420
    3 months ago

    Yes that is released



    What version are you on?

  • default discord avatar
    agolovan
    3 months ago

    "payload": "^1.9.5",



    I think I put Edit in a wrong place, under fields.



    This works correctly


    const TagsCollection: CollectionConfig = {


    slug: TAGS_COLLECTION,


    admin: {


    useAsTitle: TAG,


    group: LINKABLE_GROUP,


    disableDuplicate: true,


    components: {


    edit: {


    SaveButton: CustomSaveButton,


    },


    },


    },



    Thank you!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.