diff --git a/client/admin/lockTools/lockTools.jsx b/client/admin/lockTools/lockTools.jsx index 710a29681..6e5d7f90e 100644 --- a/client/admin/lockTools/lockTools.jsx +++ b/client/admin/lockTools/lockTools.jsx @@ -34,8 +34,7 @@ const LockTools = createClass({

-

Lock Brew

- NYI +

@@ -44,6 +43,77 @@ const LockTools = createClass({ } }); +const LockBrew = createClass({ + getInitialState : function() { + return { + brewId : '', + code : 1000, + editMessage : '', + shareMessage : '' + }; + }, + + handleChange : function(e, varName) { + const output = {}; + output[varName] = e.target.value; + this.setState(output); + }, + + submit : function(e){ + e.preventDefault(); + if(!this.state.editMessage) return; + const newLock = { + code : parseInt(this.state.code) || 100, + editMessage : this.state.editMessage, + shareMessage : this.state.shareMessage, + applied : new Date, + locked : true + }; + + request.post(`/admin/lock/${this.state.brewId}`) + .send(newLock) + .set('Content-Type', 'application/json') + .then((response)=>{ + console.log(response.body); + }); + }, + + renderInput : function (name) { + return this.handleChange(e, name)} autoComplete='off' required/>; + }, + + render : function() { + return
+

Lock Brew

+
+ +
+ +
+ +
+ +
+ +
+
; + } +}); + const LockTable = createClass({ getDefaultProps : function() { return { @@ -140,6 +210,7 @@ const LockLookup = createClass({ }, renderResult : function(){ + console.log(this.state.result); return <>

Result: