Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SamDudley committed Oct 9, 2024
1 parent 4fb0dd4 commit d7d8c4d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions payroll/templates/payroll/page/edit_payroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,21 @@

{{ payroll_data|json_script:'payroll-data' }}

<script>
<script type="module">
function getScriptJsonData(id) {
return JSON.parse(document.getElementById(id).textContent);
return new Promise((resolve, reject) => {
const json = JSON.parse(document.getElementById(id).textContent);
resolve(json);
});
}

console.log(getScriptJsonData("payroll-data"));
function getPayrollData() {
return getScriptJsonData("payroll-data");
}

// EXAMPLE
// const payrollData = await getPayrollData();
// console.log(payrollData);
</script>

{% endblock content %}

0 comments on commit d7d8c4d

Please sign in to comment.