This repository has been archived by the owner on Nov 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var notyf = new Notyf(); | ||
var modelBuyBtn = document.querySelector("#modelBuyBtn"); | ||
|
||
modelBuyBtn.addEventListener("click", (e) => { | ||
e.preventDefault(); | ||
let credits = document.querySelector("#credits").value; | ||
let name = document.querySelector("#name").value; | ||
let link = document.querySelector("#link").value; | ||
|
||
fetch("/market/model/buy", { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
credits, | ||
name, | ||
link, | ||
}), | ||
}) | ||
.then((res) => res.json()) | ||
.then((data) => { | ||
if (data.status == 400) { | ||
notyf.error(data.msg); | ||
} else { | ||
notyf.success(data.msg); | ||
setTimeout(() => { | ||
window.location.href = "/market/finish"; | ||
}, 3000); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h1>Thank You for Shopping With us !</h1> | ||
<script> | ||
window.addEventListener('load', (e) => { | ||
setTimeout(() => { | ||
window.location.href = '/dashboard'; | ||
}, 3000); | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
<h1>Recommendation</h1> | ||
<h1>Recommendation</h1> | ||
Model: <%= recommendedModel["modelName"] %> <br><br> | ||
2D Image: <a href="<%= recommendedModel["modelLink"] %>">Here</a> <br><br> | ||
Cost: <%= recommendedModel["credits"] %> Credits <br><br> | ||
<form id="modelBuyForm"> | ||
|
||
<input type="hidden" name="modelName" value="<%= recommendedModel.modelName %>" id="name"> | ||
<input type="hidden" name="modelLink" value="<%= recommendedModel.modelLink %>" id="link"> | ||
<input type="hidden" name="credits" value="<%= recommendedModel.credits %>" id="credits"> | ||
<button id="modelBuyBtn">Buy</button> | ||
</form> | ||
<script src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script> | ||
<script src="/js/model.js"></script> |