Fix: Call history is now sorted.

Call history Is now ordered by ID so recent calls show up first instead of last. Previously it was just at the bottom.

(Courtesy of Chip)
This commit is contained in:
RockySouthpaw authored and GitHub committed 2021-02-16 20:57:09 -05:00
1 parent 17f5fb62d9
commit 6be68c8e9f
1 file changed
+1 -1
+1 -1
View File
@@ -56,7 +56,7 @@ async function updateCall(call: ICall, isAccepted: boolean, end: number) {
async function fetchCalls(phoneNumber: string): Promise<ICall[]> {
const query =
'SELECT * FROM npwd_calls WHERE receiver = ? OR transmitter = ?';
'SELECT * FROM npwd_calls WHERE receiver = ? OR transmitter = ? ORDER BY id DESC';
const [result] = await pool.query(query, [phoneNumber, phoneNumber]);
const calls = <ICall[]>result;
return calls;