-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinance.js
37 lines (36 loc) · 1.28 KB
/
finance.js
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
36
37
import QueryString from 'querystring'
export default {
getWithdraws (http, userId, start, end, page) {
let queries = {
page
}
if (start) {
queries['created[min]'] = start
}
if (end) {
queries['created[max]'] = end
}
let queriesString = QueryString.stringify(queries)
let rqUrl = 'api/rest/views/finance/withdraws/' + userId + '?_format=json'
if (queriesString !== '') rqUrl += '&' + queriesString
return http.get(rqUrl)
},
getAccounts (http, userId) {
return http.get('api/rest/views/finance/accounts/' + userId + '?_format=json')
},
getTransferMethods (http, userId) {
return http.get('api/rest/views/finance/transfer-methods/' + userId + '?_format=json')
},
createTransferMethods (http, data) {
return http.post('entity/finance_transfer_method?_format=json', data)
},
updateTransferMethods (http, transferMethodId, data) {
return http.patch('admin/finance/finance_transfer_method/' + transferMethodId + '?_format=json', data)
},
getAccountWithdrawLimitation (http, accountId) {
return http.get('api/rest/finance/withdraw-limitation/' + accountId + '?_format=json')
},
applyWithdraw (http, accountId, data) {
return http.post('api/rest/finance/apply-withdraw/' + accountId + '?_format=json', data)
}
}