File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/common/backend/services/notion Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ export default class NotionDocumentService implements DocumentService {
82
82
Object . keys ( spaces ) . map ( async ( p ) => {
83
83
const space = spaces [ p ] ;
84
84
const recentPages = await this . getRecentPageVisits ( space . spaceId , userId ) ;
85
- return this . loadSpace ( space . spaceId , space . table , recentPages ) ;
85
+ const spaceName = await this . getSpaceName ( space . spaceId ) ;
86
+ return this . loadSpace ( space . spaceId , spaceName , recentPages ) ;
86
87
} )
87
88
) ;
88
89
@@ -114,6 +115,20 @@ export default class NotionDocumentService implements DocumentService {
114
115
return response . data . users [ userId ] . user_root [ userId ] . value . space_view_pointers ;
115
116
} ;
116
117
118
+ getSpaceName = async ( spaceId : string ) => {
119
+ const response = await this . requestWithCookie . post < {
120
+ results : [
121
+ {
122
+ name : string ;
123
+ }
124
+ ]
125
+ } > ( 'api/v3/getPublicSpaceData' , {
126
+ spaceIds : [ spaceId ] ,
127
+ type : 'space-ids'
128
+ } ) ;
129
+ return response . data . results [ 0 ] . name ;
130
+ }
131
+
117
132
createDocument = async ( {
118
133
repositoryId,
119
134
title,
You can’t perform that action at this time.
0 commit comments