a
This commit is contained in:
@@ -141,6 +141,18 @@ public class TransactionResource {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/forAccount/{userAccountId}")
|
||||||
|
public List<TransactionDTO> getAllTransactionsForAccountId(
|
||||||
|
@PathVariable(value = "userAccountId", required = false) final Long userAccountId,
|
||||||
|
@RequestParam(name = "eagerload", required = false, defaultValue = "true") boolean eagerload
|
||||||
|
) {
|
||||||
|
List<TransactionDTO> allTransactions = getAllTransactions(true);
|
||||||
|
if (userAccountId != null) {
|
||||||
|
// allTransactions.removeFirst();
|
||||||
|
}
|
||||||
|
return allTransactions;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code GET /transactions} : get all the transactions.
|
* {@code GET /transactions} : get all the transactions.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default defineComponent({
|
|||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
setup(props) {
|
||||||
const transactionService = inject('transactionService', () => new TransactionService());
|
const transactionService = inject('transactionService', () => new TransactionService());
|
||||||
const alertService = inject('alertService', () => useAlertService(), true);
|
const alertService = inject('alertService', () => useAlertService(), true);
|
||||||
|
|
||||||
@@ -23,11 +23,13 @@ export default defineComponent({
|
|||||||
const isFetching = ref(false);
|
const isFetching = ref(false);
|
||||||
|
|
||||||
const clear = () => {};
|
const clear = () => {};
|
||||||
|
// console.log(props.userAccountId);
|
||||||
const retrieveTransactions = async () => {
|
const retrieveTransactions = async () => {
|
||||||
isFetching.value = true;
|
isFetching.value = true;
|
||||||
try {
|
try {
|
||||||
|
// console.log(props);
|
||||||
const res = await transactionService().retrieve();
|
const res = await transactionService().retrieve();
|
||||||
|
// const res = await transactionService().retrieveForAccount(props.userAccountId);
|
||||||
transactions.value = res.data;
|
transactions.value = res.data;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alertService.showHttpError(err.response);
|
alertService.showHttpError(err.response);
|
||||||
|
|||||||
@@ -30,6 +30,19 @@ export default class TransactionService {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// public retrieveForAccount(userAccountId: any): Promise<any> {
|
||||||
|
// return new Promise<any>((resolve, reject) => {
|
||||||
|
// axios
|
||||||
|
// .get(`${baseApiUrl}/forAccount/${userAccountId}`)
|
||||||
|
// .then(res => {
|
||||||
|
// resolve(res);
|
||||||
|
// })
|
||||||
|
// .catch(err => {
|
||||||
|
// reject(err);
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
public delete(id: number): Promise<any> {
|
public delete(id: number): Promise<any> {
|
||||||
return new Promise<any>((resolve, reject) => {
|
return new Promise<any>((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user