heya
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
parent
ef3b65b1c0
commit
a321c27376
@ -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": {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { CollectionConfig } from "payload/types";
|
||||
import fetch from "node-fetch";
|
||||
const Posts: CollectionConfig = {
|
||||
slug: "posts",
|
||||
admin: {
|
||||
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user