I want to get all expenses in the format given below.so when I hit the URL
api/expenses
I get the result in the following manner and also when I call api/expenses/<id>
it shows all expense with that expense id.
What Query should I use to get Output in the above format? How will my view look like? How can I separate own
and lend
?