mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-03 14:52:38 +00:00
Popup error when gDrive credentials are expired on both /edit and /new
This commit is contained in:
@@ -141,9 +141,12 @@ const newGoogleBrew = async (req, res, next)=>{
|
||||
|
||||
req.body = brew;
|
||||
|
||||
const newBrew = await GoogleActions.newGoogleBrew(oAuth2Client, brew);
|
||||
|
||||
return res.status(200).send(newBrew);
|
||||
try {
|
||||
const newBrew = await GoogleActions.newGoogleBrew(oAuth2Client, brew);
|
||||
return res.status(200).send(newBrew);
|
||||
} catch (err) {
|
||||
return res.status(err.response.status).send(err);
|
||||
}
|
||||
};
|
||||
|
||||
const updateGoogleBrew = async (req, res, next)=>{
|
||||
@@ -154,9 +157,12 @@ const updateGoogleBrew = async (req, res, next)=>{
|
||||
const brew = req.body;
|
||||
brew.text = mergeBrewText(brew.text, brew.style);
|
||||
|
||||
const updatedBrew = await GoogleActions.updateGoogleBrew(oAuth2Client, brew);
|
||||
|
||||
return res.status(200).send(updatedBrew);
|
||||
try {
|
||||
const updatedBrew = await GoogleActions.updateGoogleBrew(oAuth2Client, brew);
|
||||
return res.status(200).send(updatedBrew);
|
||||
} catch (err) {
|
||||
return res.status(err.response.status).send(err);
|
||||
}
|
||||
};
|
||||
|
||||
router.post('/api', newBrew);
|
||||
|
||||
Reference in New Issue
Block a user