Skip to content

Commit

Permalink
fix for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Mar 23, 2022
1 parent 9abbfb7 commit 94eaf50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class NotionAdapter extends NotionClient {
}
}
async createPage(input) {
const ghLabels = input.lables.map((l) => ({ name: l.name }));
try {
await this.client.pages.create({
parent: {
Expand All @@ -101,6 +102,9 @@ class NotionAdapter extends NotionClient {
},
State: {
select: { name: input.state }
},
Label: {
multi_select: ghLabels
}
}
});
Expand Down
4 changes: 4 additions & 0 deletions src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class NotionAdapter extends NotionClient {
}

async createPage(input: IPageInput): Promise<{ error?: Error | unknown; }> {
const ghLabels = input.lables.map((l: any) => ({name: l.name}))
try {
await this.client.pages.create({
parent: {
Expand All @@ -87,6 +88,9 @@ export class NotionAdapter extends NotionClient {
},
State: {
select: { name: input.state }
},
Label: {
multi_select: ghLabels
}
}
});
Expand Down

0 comments on commit 94eaf50

Please sign in to comment.