0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 14:12:40 +00:00

Small bug causing crashes with Tags (#1152)

Also: Force Google to always send to trash instead of fully deleting.

Remove unneeded console.logs to speed up server.
This commit is contained in:
Trevor Buckner
2020-12-11 16:18:28 -05:00
committed by GitHub
parent e127855d84
commit 980fdf5ad1

View File

@@ -73,8 +73,6 @@ GoogleActions = {
console.error(err);
});
console.log('created new drive folder with ID:');
console.log(obj.data.id);
folderId = obj.data.id;
} else {
folderId = obj.data.files[0].id;
@@ -149,13 +147,7 @@ GoogleActions = {
updateGoogleBrew : async (auth, brew)=>{
const drive = google.drive({ version: 'v3', auth: auth });
console.log('trying to update a brew');
console.log(brew);
if(await GoogleActions.existsGoogleBrew(auth, brew.googleId) == true) {
console.log('the brew exists at least');
console.log('going to put this text:');
console.log(brew.text);
await drive.files.update({
fileId : brew.googleId,
resource : { name : `${brew.title}.txt`,
@@ -282,7 +274,7 @@ GoogleActions = {
text : file.data,
description : obj.data.description,
tags : obj.data.properties.tags ? obj.data.properties.tags.split(',') : [],
tags : obj.data.properties.tags ? obj.data.properties.tags : '',
systems : obj.data.properties.systems ? obj.data.properties.systems.split(',') : [],
authors : [],
published : obj.data.properties.published ? obj.data.properties.published == 'true' : false,
@@ -323,8 +315,9 @@ GoogleActions = {
throw ('Not authorized to delete this Google brew');
}
await drive.files.delete({
fileId : googleId
await drive.files.update({
fileId : googleId,
resource : { trashed: true }
})
.catch((err)=>{
console.log('Can\'t delete Google file');