mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 01:22:44 +00:00
Merge branch 'master' into addEditorThemes-#362
This commit is contained in:
@@ -99,23 +99,31 @@ const GoogleActions = {
|
|||||||
listGoogleBrews : async (auth)=>{
|
listGoogleBrews : async (auth)=>{
|
||||||
const drive = googleDrive.drive({ version: 'v3', auth });
|
const drive = googleDrive.drive({ version: 'v3', auth });
|
||||||
|
|
||||||
const obj = await drive.files.list({
|
const fileList = [];
|
||||||
pageSize : 1000,
|
let NextPageToken = "";
|
||||||
fields : 'nextPageToken, files(id, name, description, createdTime, modifiedTime, properties)',
|
|
||||||
q : 'mimeType != \'application/vnd.google-apps.folder\' and trashed = false'
|
|
||||||
})
|
|
||||||
.catch((err)=>{
|
|
||||||
console.log(`Error Listing Google Brews`);
|
|
||||||
console.error(err);
|
|
||||||
throw (err);
|
|
||||||
//TODO: Should break out here, but continues on for some reason.
|
|
||||||
});
|
|
||||||
|
|
||||||
if(!obj.data.files.length) {
|
do {
|
||||||
|
const obj = await drive.files.list({
|
||||||
|
pageSize : 1000,
|
||||||
|
pageToken : NextPageToken || "",
|
||||||
|
fields : 'nextPageToken, files(id, name, description, createdTime, modifiedTime, properties)',
|
||||||
|
q : 'mimeType != \'application/vnd.google-apps.folder\' and trashed = false'
|
||||||
|
})
|
||||||
|
.catch((err)=>{
|
||||||
|
console.log(`Error Listing Google Brews`);
|
||||||
|
console.error(err);
|
||||||
|
throw (err);
|
||||||
|
//TODO: Should break out here, but continues on for some reason.
|
||||||
|
});
|
||||||
|
fileList.push(...obj.data.files);
|
||||||
|
NextPageToken = obj.data.nextPageToken;
|
||||||
|
} while (NextPageToken);
|
||||||
|
|
||||||
|
if(!fileList.length) {
|
||||||
console.log('No files found.');
|
console.log('No files found.');
|
||||||
}
|
}
|
||||||
|
|
||||||
const brews = obj.data.files.map((file)=>{
|
const brews = fileList.map((file)=>{
|
||||||
return {
|
return {
|
||||||
text : '',
|
text : '',
|
||||||
shareId : file.properties.shareId,
|
shareId : file.properties.shareId,
|
||||||
|
|||||||
Reference in New Issue
Block a user