mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-22 14:27:10 +00:00
Move googleDrive button into common hook
This commit is contained in:
1 parent
a50dda6377
commit
0281e4e309
4 files changed
+86
-99
No files matched your search
@@ -23,12 +23,11 @@ const NewPage = (props)=>{
|
||||
};
|
||||
|
||||
const [currentBrew, setCurrentBrew] = useState(props.brew);
|
||||
const [saveGoogle, setSaveGoogle] = useState(global.account?.googleId ? true : false);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
const save = async (brew, saveToGoogle)=>{
|
||||
const res = await request
|
||||
.post(`/api${saveGoogle ? '?saveToGoogle=true' : ''}`)
|
||||
.post(`/api${saveToGoogle ? '?saveToGoogle=true' : ''}`)
|
||||
.send(brew)
|
||||
.catch((err)=>{
|
||||
console.error('Error Updating Local Brew');
|
||||
@@ -47,8 +46,6 @@ const NewPage = (props)=>{
|
||||
const {
|
||||
renderPanels
|
||||
} = useCommonEditPageFunctions({
|
||||
saveGoogle,
|
||||
setSaveGoogle,
|
||||
error,
|
||||
setError,
|
||||
currentBrew,
|
||||
|
||||
Reference in new issue
Block a user