refactor(calls): refactor of call architecture

This commit is contained in:
Taso committed 2021-07-28 14:26:00 -04:00
1 parent 92b687b130
commit 36d1e993bd
21 files changed
+361 -185

No files matched your search

+2 -2
View File
@@ -17,12 +17,12 @@ export class CallsRepo {
async fetchCalls(
phoneNumber: string,
limit = FetchDefaultLimits.CALLS_FETCH_LIMIT,
): Promise<CallHistoryItem[] | CallHistoryItem> {
): Promise<CallHistoryItem[]> {
const query =
'SELECT * FROM npwd_calls WHERE receiver = ? OR transmitter = ? ORDER BY id DESC LIMIT ?';
const [result] = await pool.query(query, [phoneNumber, phoneNumber, limit]);
return <CallHistoryItem[] | CallHistoryItem>result;
return <CallHistoryItem[]>result;
}
}