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 {
8282 Object . keys ( spaces ) . map ( async ( p ) => {
8383 const space = spaces [ p ] ;
8484 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 ) ;
8687 } )
8788 ) ;
8889
@@ -114,6 +115,20 @@ export default class NotionDocumentService implements DocumentService {
114115 return response . data . users [ userId ] . user_root [ userId ] . value . space_view_pointers ;
115116 } ;
116117
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+
117132 createDocument = async ( {
118133 repositoryId,
119134 title,
You can’t perform that action at this time.
0 commit comments