1
1
// Import the axios instance from the local file "./axios"
2
2
import axios from "./axios"
3
3
4
- // Parse the search parameters from the URL
5
- let searchParams = new URLSearchParams ( window . location . search )
6
-
7
4
class datatable {
8
5
constructor ( ) {
9
6
10
7
}
11
8
12
9
// Method to perform a GET request
13
10
async get ( url ) {
11
+ // Parse the search parameters from the URL
12
+ let searchParams = new URLSearchParams ( window . location . search )
13
+
14
14
// Retrieve values from search parameters
15
15
let page = searchParams . get ( 'page' )
16
16
let paginate = searchParams . get ( 'paginate' )
@@ -34,6 +34,9 @@ class datatable {
34
34
35
35
// Method to perform a POST request
36
36
async post ( url ) {
37
+ // Parse the search parameters from the URL
38
+ let searchParams = new URLSearchParams ( window . location . search )
39
+
37
40
// Retrieve values from search parameters
38
41
let page = searchParams . get ( 'page' )
39
42
let paginate = searchParams . get ( 'paginate' )
@@ -57,6 +60,9 @@ class datatable {
57
60
58
61
// Method to perform a PUT request
59
62
async put ( url ) {
63
+ // Parse the search parameters from the URL
64
+ let searchParams = new URLSearchParams ( window . location . search )
65
+
60
66
// Retrieve values from search parameters
61
67
let page = searchParams . get ( 'page' )
62
68
let paginate = searchParams . get ( 'paginate' )
0 commit comments