mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 12:21:31 +03:00
Fix for #800
This commit is contained in:
parent
c3a4473693
commit
5e8806934b
@ -1,6 +1,7 @@
|
|||||||
|
import { Alert } from 'react-native';
|
||||||
import ePointApi from '../../config/ePoint';
|
import ePointApi from '../../config/ePoint';
|
||||||
|
|
||||||
export const userActivity = (us, ty, bl = '', tx = '') => new Promise((resolve, reject) => {
|
export const userActivity = (us, ty, bl = '', tx = '') => new Promise((resolve) => {
|
||||||
const params = { us, ty };
|
const params = { us, ty };
|
||||||
|
|
||||||
if (bl) {
|
if (bl) {
|
||||||
@ -17,11 +18,11 @@ export const userActivity = (us, ty, bl = '', tx = '') => new Promise((resolve,
|
|||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error);
|
Alert.alert('Error', error.message);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
export const transfer = (sender, receiver, amount) => new Promise((resolve, reject) => {
|
export const transfer = (sender, receiver, amount) => new Promise((resolve) => {
|
||||||
ePointApi
|
ePointApi
|
||||||
.post('/transfer', {
|
.post('/transfer', {
|
||||||
se: sender,
|
se: sender,
|
||||||
@ -32,33 +33,33 @@ export const transfer = (sender, receiver, amount) => new Promise((resolve, reje
|
|||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error);
|
Alert.alert('Error', error.message);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getUser = username => new Promise((resolve, reject) => {
|
export const getUser = username => new Promise((resolve) => {
|
||||||
ePointApi
|
ePointApi
|
||||||
.get(`/users/${username}`)
|
.get(`/users/${username}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error);
|
Alert.alert('Error', error.message);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getUserPoints = username => new Promise((resolve, reject) => {
|
export const getUserPoints = username => new Promise((resolve) => {
|
||||||
ePointApi
|
ePointApi
|
||||||
.get(`/users/${username}/points`)
|
.get(`/users/${username}/points`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error);
|
Alert.alert('Error', error.message);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
export const claim = username => new Promise((resolve, reject) => {
|
export const claim = username => new Promise((resolve) => {
|
||||||
ePointApi
|
ePointApi
|
||||||
.put('/claim', {
|
.put('/claim', {
|
||||||
us: `${username}`,
|
us: `${username}`,
|
||||||
@ -67,6 +68,6 @@ export const claim = username => new Promise((resolve, reject) => {
|
|||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
reject(error);
|
Alert.alert('Error', error.message);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user