0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-04 16:52:38 +00:00

update metadata editor to include error handling

This commit is contained in:
Charlie Humphreys
2023-01-23 09:35:19 -06:00
parent d5a34eedb9
commit 6ddf0bb889
4 changed files with 21 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ const BrewItem = createClass({
authors : [],
stubbed : true
},
reportError : null
reportError : ()=>{}
};
},
@@ -35,7 +35,7 @@ const BrewItem = createClass({
request.delete(`/api/${this.props.brew.googleId ?? ''}${this.props.brew.editId}`)
.send()
.end((err, res)=>{
if(err && this.props.reportError) {
if(err) {
this.props.reportError(err.response);
} else {
location.reload();