generated from padok-team/yatas-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReportUpdate.go
29 lines (25 loc) · 897 Bytes
/
ReportUpdate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import (
"context"
"log"
"github.com/jomei/notionapi"
"github.com/stangirard/yatas/plugins/commons"
)
func addCategoriesTable(client *notionapi.Client, blockID notionapi.BlockID, test commons.Tests) {
updateRequest := updatePageRequestWithCategories(test)
blocks, err := client.Block.AppendChildren(context.Background(), blockID, &updateRequest)
if err != nil {
log.Printf("Error while triing to add categories table ... %v", err)
} else {
log.Printf("New blocks added ... %v", blocks)
}
}
func addTitleTable(client *notionapi.Client, blockID notionapi.BlockID, test commons.Tests) {
updateRequest := updatePageRequestWithTitle(test)
blocks, err := client.Block.AppendChildren(context.Background(), blockID, &updateRequest)
if err != nil {
log.Printf("Error while triing to add a title ... %v", err)
} else {
log.Printf("New Title added ... %v", blocks)
}
}