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
-
... ... @@ -11,23 +11,15 @@ 11 11 }); 12 12 function findCollab() { 13 13 const driveURL = document.getElementById("driveURL"); 14 - const driveId = getDriveId(driveURL .value);14 + const driveId = getDriveId(driveURL); 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 - console.log(json); 21 - const { link } = json; 22 - console.log(link) 23 -// window.location.pathname = link; 24 - }) 25 25 } 26 26 } 27 27 function getDriveId(driveURL) { 28 28 const url = new URL(driveURL); 29 - const re = /\/ (library|lib)\/([^/]*)\/.*/;30 - const id = re.exec(url.pathname)[ 2];21 + const re = /\/library\/([^/]*)\/.*/; 22 + const id = re.exec(url.pathname)[1]; 31 31 return id; 32 32 } 33 33 })();