eleven-solutions-common-website-unique-web 10.0.10 → 10.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ const apiUrl = "http://localhost:5260";
4
4
  const cookies = new Cookies();
5
5
 
6
6
  export const addUserApi = async (
7
+ url: string,
7
8
  name: string,
8
9
  email: string,
9
10
  mobile: string,
@@ -14,7 +15,7 @@ export const addUserApi = async (
14
15
 
15
16
  try {
16
17
  const response = await axios.post(
17
- `${apiUrl}/login/adduser`,
18
+ `${url}/login/adduser`,
18
19
  {
19
20
  Name: name,
20
21
  Email: email,
@@ -36,11 +37,11 @@ export const addUserApi = async (
36
37
  }
37
38
  };
38
39
 
39
- export const fetchUsersApi = async () => {
40
+ export const fetchUsersApi = async (url: string) => {
40
41
  const token = cookies.get("token");
41
42
 
42
43
  try {
43
- const response = await axios.get(`${apiUrl}/login/getuser`, {
44
+ const response = await axios.get(`${url}/login/getuser`, {
44
45
  headers: {
45
46
  Authorization: `Bearer ${token}`,
46
47
  },
@@ -52,12 +53,12 @@ export const fetchUsersApi = async () => {
52
53
  }
53
54
  };
54
55
 
55
- export const fetchUserByIdApi = async (userId: string) => {
56
+ export const fetchUserByIdApi = async (url: string, userId: string) => {
56
57
  const cookies = new Cookies();
57
58
  const token = cookies.get("token");
58
59
 
59
60
  try {
60
- const response = await axios.get(`${apiUrl}/login/getuserbyid/${userId}`, {
61
+ const response = await axios.get(`${url}/login/getuserbyid/${userId}`, {
61
62
  headers: {
62
63
  Authorization: `Bearer ${token}`,
63
64
  },
@@ -70,13 +71,13 @@ export const fetchUserByIdApi = async (userId: string) => {
70
71
  }
71
72
  };
72
73
 
73
- export const deleteUserApi = async (id: string) => {
74
+ export const deleteUserApi = async (url: string, id: string) => {
74
75
  const token = cookies.get("token");
75
76
 
76
77
  try {
77
78
  const response = await axios.request({
78
79
  method: "DELETE",
79
- url: `${apiUrl}/login/delete`,
80
+ url: `${url}/login/delete`,
80
81
  headers: {
81
82
  Authorization: `Bearer ${token}`,
82
83
  "Content-Type": "application/json",
@@ -93,6 +94,8 @@ export const deleteUserApi = async (id: string) => {
93
94
  };
94
95
 
95
96
  export const updateUserApi = async (
97
+ url: string,
98
+
96
99
  id: string,
97
100
  name: string,
98
101
  mobile: string,
@@ -103,7 +106,7 @@ export const updateUserApi = async (
103
106
 
104
107
  try {
105
108
  const response = await axios.post(
106
- `${apiUrl}/login/updateuser`,
109
+ `${url}/login/updateuser`,
107
110
  {
108
111
  id: id,
109
112
  name: name,