improve pagination
This commit is contained in:
		@ -25,7 +25,14 @@ All Sales
 | 
			
		||||
{{ end }}
 | 
			
		||||
{{ define "js" }}
 | 
			
		||||
<script type="module">
 | 
			
		||||
    import {showTable, pageSize, currentPage} from "/static/js/all-sales.js"
 | 
			
		||||
    showTable({{.API}}, pageSize, currentPage);
 | 
			
		||||
    import {pageSize} from "/static/js/common.js"
 | 
			
		||||
    import {showTable, currentPage} from "/static/js/all-sales.js"
 | 
			
		||||
 | 
			
		||||
    let curPage = currentPage;
 | 
			
		||||
    if (localStorage.getItem("cur-page") !== null) {
 | 
			
		||||
        curPage = localStorage.getItem("cur-page");
 | 
			
		||||
        localStorage.removeItem("cur-page");
 | 
			
		||||
    }
 | 
			
		||||
    showTable({{.API}}, pageSize, curPage);
 | 
			
		||||
</script>
 | 
			
		||||
{{ end }}
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,14 @@ All Subscriptions
 | 
			
		||||
 | 
			
		||||
{{define "js"}}
 | 
			
		||||
<script type="module">
 | 
			
		||||
    import {showTable, pageSize, currentPage} from "/static/js/all-subscriptions.js"
 | 
			
		||||
    showTable({{.API}}, pageSize, currentPage);
 | 
			
		||||
    import {pageSize} from "/static/js/common.js"
 | 
			
		||||
    import {showTable, currentPage} from "/static/js/all-subscriptions.js"
 | 
			
		||||
 | 
			
		||||
    let curPage = currentPage;
 | 
			
		||||
    if (localStorage.getItem("cur-page") !== null) {
 | 
			
		||||
        curPage = localStorage.getItem("cur-page");
 | 
			
		||||
        localStorage.removeItem("cur-page");
 | 
			
		||||
    }
 | 
			
		||||
    showTable({{.API}}, pageSize, curPage);
 | 
			
		||||
</script>
 | 
			
		||||
{{end}}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user