From d5c4c23500289157ccc50a65bdf38cd08519ec83 Mon Sep 17 00:00:00 2001 From: Max Schmidt Date: Wed, 17 May 2023 18:26:23 +0200 Subject: [PATCH] test Signed-off-by: Max Schmidt --- payload/src/collections/Posts.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/payload/src/collections/Posts.ts b/payload/src/collections/Posts.ts index dde63e7..fca485b 100644 --- a/payload/src/collections/Posts.ts +++ b/payload/src/collections/Posts.ts @@ -11,7 +11,22 @@ const Posts: CollectionConfig = { create: () => true, update: () => true, }, - + hooks: { + afterChange: [ + async () => { + await fetch("https://api.github.com/repos/mooxl/astroad/dispatches", { + method: "POST", + headers: { + Accept: "application/vnd.github.everest-preview+json", + Authorization: "token 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", + }, + body: JSON.stringify({ + event_type: "payload_update", + }), + }); + }, + ], + }, fields: [ { name: "title",