Clean up destroy routine

This commit is contained in:
James Cole
2022-02-28 17:06:01 +01:00
parent 22a6e34279
commit b9536dfe4e
26 changed files with 188 additions and 368 deletions

View File

@@ -18,18 +18,34 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {api} from "boot/axios";
import Api from "src/api/root/api";
export default class Get {
get(identifier, date) {
let url = '/api/v1/accounts/' + identifier;
if(!date) {
return api.get(url);
}
return api.get(url, {params: {date: date}});
export default class Get extends Api {
constructor() {
super('accounts'); // call the super class constructor and pass in the name parameter
}
transactions(identifier, page, cacheKey) {
let url = '/api/v1/accounts/' + identifier + '/transactions';
return api.get(url, {params: {page: page, cache: cacheKey}});
/**
*
* @param identifier
* @param date
* @returns {Promise<AxiosResponse<any>>}
*/
get(identifier, date) {
let params = {date: date};
if(!date) {
return this.apiGet(identifier);
}
return this.apiGet(identifier, params);
}
/**
*
* @param identifier
* @param page
* @returns {Promise<AxiosResponse<any>>}
*/
transactions(identifier, page) {
return this.apiGetChildren('transactions', identifier, page);
}
}