mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 01:42:42 +00:00
update readFileMetadata to be getGoogleBrew
This commit is contained in:
@@ -25,7 +25,7 @@ const getBrewFromId = asyncHandler(async (id, accessType)=>{
|
|||||||
if(id.length > 12) {
|
if(id.length > 12) {
|
||||||
const googleId = id.slice(0, -12);
|
const googleId = id.slice(0, -12);
|
||||||
id = id.slice(-12);
|
id = id.slice(-12);
|
||||||
brew = await GoogleActions.readFileMetadata(googleId, id, accessType);
|
brew = await GoogleActions.getGoogleBrew(googleId, id, accessType);
|
||||||
} else {
|
} else {
|
||||||
brew = await HomebrewModel.get(accessType == 'edit' ? { editId: id } : { shareId: id });
|
brew = await HomebrewModel.get(accessType == 'edit' ? { editId: id } : { shareId: id });
|
||||||
brew = brew.toObject(); // Convert MongoDB object to standard Javascript Object
|
brew = brew.toObject(); // Convert MongoDB object to standard Javascript Object
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ const GoogleActions = {
|
|||||||
return newHomebrew;
|
return newHomebrew;
|
||||||
},
|
},
|
||||||
|
|
||||||
readFileMetadata : async (id, accessId, accessType)=>{
|
getGoogleBrew : async (id, accessId, accessType)=>{
|
||||||
const drive = google.drive({ version: 'v3' });
|
const drive = google.drive({ version: 'v3' });
|
||||||
|
|
||||||
const obj = await drive.files.get({
|
const obj = await drive.files.get({
|
||||||
|
|||||||
Reference in New Issue
Block a user