mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 02:32:41 +00:00
remove test, fix issues
This commit is contained in:
@@ -141,7 +141,6 @@ app.get('/', (req, res, next)=>{
|
|||||||
title : 'Homepage',
|
title : 'Homepage',
|
||||||
description : 'Homepage'
|
description : 'Homepage'
|
||||||
};
|
};
|
||||||
console.log(req.account);
|
|
||||||
|
|
||||||
splitTextStyleAndMetadata(req.brew);
|
splitTextStyleAndMetadata(req.brew);
|
||||||
return next();
|
return next();
|
||||||
|
|||||||
@@ -420,6 +420,9 @@ const api = {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
deleteBrew : async (req, res, next)=>{
|
deleteBrew : async (req, res, next)=>{
|
||||||
|
|
||||||
|
console.log('starting to delete');
|
||||||
|
console.log(req.brew);
|
||||||
// Delete an orphaned stub if its Google brew doesn't exist
|
// Delete an orphaned stub if its Google brew doesn't exist
|
||||||
try {
|
try {
|
||||||
await api.getBrew('edit')(req, res, ()=>{});
|
await api.getBrew('edit')(req, res, ()=>{});
|
||||||
@@ -436,6 +439,7 @@ const api = {
|
|||||||
let brew = req.brew;
|
let brew = req.brew;
|
||||||
const { googleId, editId } = brew;
|
const { googleId, editId } = brew;
|
||||||
const account = req.account;
|
const account = req.account;
|
||||||
|
//if in local, may test this with: const account = req.account || { username: 'a' };
|
||||||
const isOwner = account && (brew.authors.length === 0 || brew.authors[0] === account.username);
|
const isOwner = account && (brew.authors.length === 0 || brew.authors[0] === account.username);
|
||||||
// If the user is the owner and the file is saved to google, mark the google brew for deletion
|
// If the user is the owner and the file is saved to google, mark the google brew for deletion
|
||||||
const shouldDeleteGoogleBrew = googleId && isOwner;
|
const shouldDeleteGoogleBrew = googleId && isOwner;
|
||||||
|
|||||||
Reference in New Issue
Block a user