summaryrefslogtreecommitdiff
path: root/client/src/services/apiservice.js
blob: 3d02dd468934117cce3e5dc6901196c901d7ec8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import axios from 'axios'

const apiClient = axios.create({
  baseURL: 'https://aadhaar-kiosk-server.onrender.com'
})

export const createUser = async (payload) => {
  const response = await apiClient.post('/user', payload)
  return response
}

export const getUserByAadhaar = async (aadhaarNumber) => {
  const response = await apiClient.get(`/user/aadhaar/${aadhaarNumber}`)
  return response
}

export const getUser = async (id, payload) => {
  const response = await apiClient.get(`/user/${id}`, payload)
  return response
}

export const updateUser = async (id, payload) => {
  const response = await apiClient.patch(`/user/${id}`, payload)
  return response
}

export const sendOTP = async (payload) => {
  const response = await apiClient.post('/otp', payload)
  return response
}

export const sendMessage = async (payload) => {
  const response = await apiClient.post('/message', payload)
  return response
}