mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
Automatically re-check for scripts
Adding a separate `keepText` field for the `updateBrew()` API might be a bandaid for something that should be looked at more deeply as a separate refactor, considering `updateBrew()` is configured to just return the stub and not the whole document. For now, re-scanning for script tags after updating can be as simple as just re-looking up the brew.
This commit is contained in:
@@ -44,13 +44,13 @@ const BrewLookup = createClass({
|
||||
});
|
||||
},
|
||||
|
||||
cleanScript(){
|
||||
async cleanScript(){
|
||||
if(!this.state.foundBrew?.shareId) return;
|
||||
|
||||
request.put(`/admin/clean/script/${this.state.foundBrew.shareId}`)
|
||||
.then((res)=>this.setState({ foundBrew: res.body }))
|
||||
.catch((err)=>this.setState({ error: err }))
|
||||
.finally(()=>this.setState({ scriptCount: 0 }));
|
||||
await request.put(`/admin/clean/script/${this.state.foundBrew.shareId}`)
|
||||
.catch((err)=>{ this.setState({ error: err }); return; });
|
||||
|
||||
this.lookup();
|
||||
},
|
||||
|
||||
renderFoundBrew(){
|
||||
|
||||
Reference in New Issue
Block a user