Skip to content

Commit

Permalink
Add hidden input field to provide account on submit #19
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Mar 4, 2024
1 parent 01fa461 commit 64e15c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<a title="Please provide the same account for all your uploads. The account is part of the reconcile service url."></a>
<% } %>
</label>
<input style="display: none" name="account" id="account" value="<%- data?.user?.id %>" />
<label for="language">Language to use for Reconciliation
<a title="Reconciliation is done against a specific language. So tell us what language of your vocabulary we should use."></a>
Expand Down Expand Up @@ -123,7 +124,7 @@
<script>
const uploadForm = document.querySelector(".uploadForm")
const account = "<%=- JSON.stringify(data) %>"
const account = <%-JSON.stringify(data)%>
const language = document.querySelector("#language")
const file_upload = document.querySelector("#file_upload")
const fileUrl = document.querySelector("#fileUrl")
Expand All @@ -137,7 +138,7 @@
const url = new URL(window.location.href)
const idParam = url.searchParams.get("id")
const buildReconcileUrl = (serviceUrl, account, dataset, language) => `${serviceUrl}/reconcile?language=${language}&account=${account.user.id}&dataset=${dataset}`
const buildReconcileUrl = (serviceUrl, account, dataset, language) => `${serviceUrl}/reconcile?language=${language}&account=${account}&dataset=${dataset}`
// crypto.randomUUID() is only available in https contextx or localhost / 127.0.0.1
// therefore I took this uuid function from https://stackoverflow.com/a/8809472
Expand Down

0 comments on commit 64e15c5

Please sign in to comment.