Skip to content
Snippets Groups Projects
Commit f243d2c9 authored by Seb Barnard's avatar Seb Barnard :speech_balloon:
Browse files

Merge branch 'issueThirtySeven' into 'develop'

Issue thirty seven

See merge request !112
parents 8966d90b 77320dcf
Branches
No related tags found
2 merge requests!114LoggingService service class, new method to add a log to the "Logs" table when...,!112Issue thirty seven
......@@ -68,7 +68,7 @@ public class StampboardUpdater {
jdbc.execute(query);
// Log the change
loggingService.logEvent(
"StampBoard Updated",
"Stamp Board Updated",
session,
"StampBoard updated for Shop: " + shopId +
" with: field Stamp_BoardSize with value:" + size +
......
src/main/resources/static/imgs/uploaded/6d59ca26_4438_4db0_948f_aaf8c81ec188.png

114 KiB

src/main/resources/static/imgs/uploaded/c19d7850_e484_4649_92bd_acf558d68811.png

114 KiB

src/main/resources/static/imgs/uploaded/ca7344f3_9ce2_47b0_9c9d_c079cf3185bd.png

114 KiB

......@@ -15,15 +15,33 @@ async function submitFile(inputName) {
}
};
xhttp.send(formData);
}else{
reject("")
}
})
}
async function submitInfo(shopId) {
let bannerName = await submitFile("bannerInput");
let logoName = await submitFile("logoInput")
document.getElementById("saveInfoButton").classList.add("is-loading")
let bannerName, logoName
try{
bannerName = await submitFile("bannerInput");
}catch(e){
console.log(e)
bannerName = ""
}
try{
logoName = await submitFile("logoInput");
}catch(e){
console.log(e)
logoName = ""
}
var xhttp = new XMLHttpRequest();
let params = "shopId=" + shopId
params += "&shopName=" + encodeURIComponent(document.getElementById("nameInput").value)
params += "&shopDescription=" + encodeURIComponent(document.getElementById("descriptionInput").value)
......@@ -34,7 +52,9 @@ async function submitInfo(shopId) {
xhttp.onload = function () {
if (xhttp.readyState === 4 && xhttp.status === 200) {
var response = xhttp.responseText
if (response == "success") {
if (response == "OK") {
document.getElementById("saveInfoButton").classList.remove("is-loading")
document.getElementById("infoSuccess").innerHTML = "Changes Saved!"
} else {
}
} else {
......
......@@ -47,7 +47,8 @@
</label>
</div>
<button th:onclick="'submitInfo('+ ${shop.shopId} +');'" class="button is-link" style="margin-top:15px; margin-bottom:10px;">Save changes</button>
<button id="saveInfoButton" th:onclick="'submitInfo('+ ${shop.shopId} +');'" class="button is-link" style="margin-top:15px; margin-bottom:10px;">Save changes</button>
<p class="help is-success" id="infoSuccess"></p>
</div>
<p style="border-bottom: #000000 1px solid;"></p>
</body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment