Skip to content

Commit

Permalink
heya
Browse files Browse the repository at this point in the history
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
  • Loading branch information
mooxl committed May 17, 2023
1 parent ef3b65b commit a321c27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
1 change: 0 additions & 1 deletion payload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"cross-env": "^7.0.3",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"node-fetch": "^3.3.1",
"payload": "^1.8.2"
},
"devDependencies": {
Expand Down
28 changes: 16 additions & 12 deletions payload/src/collections/Posts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CollectionConfig } from "payload/types";
import fetch from "node-fetch";
const Posts: CollectionConfig = {
slug: "posts",
admin: {
Expand All @@ -14,18 +13,23 @@ const Posts: CollectionConfig = {
hooks: {
afterChange: [
async () => {
console.log("HALLO");
try {
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",
}),
});
console.log(
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",
}),
}
)
);
} catch (e) {
console.log(e);
}
Expand Down

0 comments on commit a321c27

Please sign in to comment.