db/events: remove unnecessary overloads
This commit is contained in:
parent
8f45f3a7ad
commit
4602b85afe
|
@ -105,9 +105,7 @@ function getFilterQuery(filter: DittoFilter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get events for filters from the database. */
|
/** Get events for filters from the database. */
|
||||||
async function getFilters<K extends number>(filters: [DittoFilter<K>]): Promise<SignedEvent<K>[]>;
|
async function getFilters<K extends number>(filters: DittoFilter<K>[]): Promise<SignedEvent<K>[]> {
|
||||||
async function getFilters(filters: DittoFilter[]): Promise<SignedEvent[]>;
|
|
||||||
async function getFilters(filters: DittoFilter[]) {
|
|
||||||
const queries = filters
|
const queries = filters
|
||||||
.map(getFilterQuery)
|
.map(getFilterQuery)
|
||||||
.map((query) => query.execute());
|
.map((query) => query.execute());
|
||||||
|
@ -115,7 +113,7 @@ async function getFilters(filters: DittoFilter[]) {
|
||||||
const events = (await Promise.all(queries)).flat();
|
const events = (await Promise.all(queries)).flat();
|
||||||
|
|
||||||
return events.map((event) => (
|
return events.map((event) => (
|
||||||
{ ...event, tags: JSON.parse(event.tags) }
|
{ ...event, tags: JSON.parse(event.tags) } as SignedEvent<K>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue