diff options
author | rohan09-raj <rajrohan1914@gmail.com> | 2022-08-14 00:19:58 +0530 |
---|---|---|
committer | rohan09-raj <rajrohan1914@gmail.com> | 2022-08-14 00:19:58 +0530 |
commit | 4e99bfe1878620769d48532b182692e51c7266ef (patch) | |
tree | c3b02c73fd5f9fba85461e00db9905ee1371a8a0 /admin/src/services/apiservice.js | |
parent | 3673947d4905948de2e466a813019b1de9629bd2 (diff) |
admin panel and api integration
Diffstat (limited to 'admin/src/services/apiservice.js')
-rw-r--r-- | admin/src/services/apiservice.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/admin/src/services/apiservice.js b/admin/src/services/apiservice.js new file mode 100644 index 0000000..0fbb614 --- /dev/null +++ b/admin/src/services/apiservice.js @@ -0,0 +1,25 @@ +import axios from 'axios'; + +const apiClient = axios.create({ + baseURL: 'http://localhost:5000', +}); + +export const getVerifiedUsers = async () => { + const response = await apiClient.get('/verifiedusers'); + return response; +}; + +export const getUnverifiedUsers = async () => { + const response = await apiClient.get('/unverifiedusers'); + return response; +}; + +export const updateUser = async (id, payload) => { + const response = await apiClient.patch(`/user/${id}`, payload); + return response; +}; + +export const deleteUser = async (id) => { + const response = await apiClient.delete(`/user/${id}`); + return response; +}; |