Changes for page DriveParentCollab
Last modified by bougault on 2022/01/07 11:03
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -14,18 +14,12 @@ 14 14 const driveId = getDriveId(driveURL.value); 15 15 if(driveId) { 16 16 console.log('Perform request with id:', driveId); 17 - fetch(`/rest/v1/collabs?driveId=${driveId}`) 18 - .then(res => res.json()) 19 - .then(json => { 20 - const { link } = json; 21 - window.location.pathname = link; 22 - }) 23 23 } 24 24 } 25 25 function getDriveId(driveURL) { 26 26 const url = new URL(driveURL); 27 27 const re = /\/(library|lib)\/([^/]*)\/.*/; 28 - const id = re.exec(url.pathname)[ 2];22 + const id = re.exec(url.pathname)[1]; 29 29 return id; 30 30 } 31 31 })();