diff --git a/src/App.js b/src/App.js index 4fd5bb5..f049ace 100644 --- a/src/App.js +++ b/src/App.js @@ -451,7 +451,7 @@ function TableEditor(p) { function SubmitBoxes() { if (!lockSubmission) { setLockSubmission(true) - axios.post(p.BACKENDURL+p.path,submitVals) + axios.post(p.BACKENDURL+p.path,{...submitVals,pass:p.password}) .then(()=>{ setSubmitVal("Clear") setUpdate(true) @@ -476,7 +476,7 @@ function TableEditor(p) { useEffect(()=>{ var promises=[] parse(fileData,{columns:true,skip_empty_lines:true}).forEach((entry)=>{ - promises.push(axios.post(p.BACKENDURL+p.path,entry)) + promises.push(axios.post(p.BACKENDURL+p.path,{...entry,pass:p.password})) }) Promise.allSettled(promises) .then(()=>{ @@ -497,7 +497,7 @@ function TableEditor(p) { if (update) { setLoading(true) var dependency_map = {} - axios.get(p.BACKENDURL+p.path) + axios.get(p.BACKENDURL+p.path+"?pass="+p.password) .then((data)=>{ var cols = data.data.fields var rows = data.data.rows @@ -507,7 +507,7 @@ function TableEditor(p) { var promise_list = [] cols.filter((col)=>col.name!=="id"&&col.name.includes("_id")).forEach((col)=>{ - promise_list.push(axios.get(p.BACKENDURL+"/"+col.name.replace("_id","")) + promise_list.push(axios.get(p.BACKENDURL+"/"+col.name.replace("_id","")+"?pass="+p.password) .then((data)=>{ dependency_map[col.name]=data.data.rows.sort((a,b)=>b.id-a.id) })) @@ -544,11 +544,12 @@ function TableEditor(p) { {{fields.map((col,i)=>{{setSubmitVal({field:col.name,value:f});}}/>})}{SubmitBoxes()}} className="submitbutton"/>} {data.map((dat)=> - {axios.delete(p.BACKENDURL+p.path,{data:{id:dat.id}}).then(()=>{setUpdate(true)}).catch((err)=>{alert(err.response.data)})}}/>{fields.map((col,i)=> + {axios.delete(p.BACKENDURL+p.path,{data:{id:dat.id,pass:p.password}}).then(()=>{setUpdate(true)}).catch((err)=>{alert(err.response.data)})}}/>{fields.map((col,i)=> { return axios.patch(p.BACKENDURL+p.path,{ [col.name]:value, - id:dat.id + id:dat.id, + pass:p.password }) }} value={String(dat[col.name])}/>)})} @@ -565,7 +566,7 @@ function DatabaseEditor(p) { useEffect(()=>{ if (update) { - axios.get(p.BACKENDURL+"/databases") + axios.get(p.BACKENDURL+"/databases?pass="+p.password) .then((data)=>{ setDatabases(data.data) }) @@ -584,7 +585,7 @@ function DatabaseEditor(p) {