1
0
mirror of https://github.com/spacebarchat/spacebarchat.git synced 2024-09-19 17:01:47 +02:00

🐛 fix github notion webhook not properly syncing

This commit is contained in:
Flam3rboy 2021-08-10 03:35:15 +02:00
parent 215f5d5196
commit b18d6d5b7e

View File

@ -148,7 +148,6 @@ class GithubNotionSync {
name: issue.state,
},
},
Repo: {
select: {
name: GithubNotionSync.getRepoNameFromUrl(issue.url),
@ -198,11 +197,10 @@ class GithubNotionSync {
if (
exists.properties.Name?.title?.[0].plain_text !== issue.title ||
exists.properties.State?.select.name !== issue.state ||
issue.labels.map((x) => x.name).missing(exists.properties.Label?.multi_select.map((x) => x.name))
.length ||
issue.assignees
.map((x) => x.login)
.missing(exists.properties.Assignee?.multi_select.map((x) => x.name)).length
JSON.stringify(issue.labels.map((x) => x.name)) !==
JSON.stringify(exists.properties.Label?.multi_select.map((x) => x.name)) ||
JSON.stringify(issue.assignees.map((x) => x.login)) !==
JSON.stringify(exists.properties.Assignee?.multi_select.map((x) => x.name))
) {
console.log("update existing one");
await this.notion.pages.update({ page_id: exists.id, properties: options.properties });