File size: 738 Bytes
16b5862
 
54420c0
16b5862
54420c0
16b5862
54420c0
 
 
16b5862
 
 
 
 
 
 
 
 
54420c0
16b5862
 
 
54420c0
16b5862
 
 
54420c0
16b5862
54420c0
16b5862
 
54420c0
16b5862
 
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 baseUrl = 'http://localhost:3000';

export const getUserStatement = async (id, skip, limit, order_by) => {
  try {
    const response = await axios.get(
      `${baseUrl}/wallet/${id}?skip=${skip}&limit=${limit}&order_by=${order_by}`
    );

    return response.data;
  } catch (error) {
    return undefined;
  }
};

export const getUserDetails = async (id) => {
  try {
    const response = await axios.get(`${baseUrl}/user/${id}`);

    return response.data;
  } catch (error) {
    return error;
  }
};

export const handleTransaction = async (body) => {
  try {
    const response = await axios.post(`${baseUrl}/wallet`, body);
    return response.data;
  } catch (error) {
    return error;
  }
};