with --> extra

This commit is contained in:
Alex Gleason 2023-12-05 19:40:40 -06:00
parent 8b4621ddfb
commit 22b1d730eb
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 4 additions and 4 deletions

View File

@ -172,7 +172,7 @@ async function getFilters<K extends number>(
if (!filters.length) return Promise.resolve([]); if (!filters.length) return Promise.resolve([]);
let query = getFiltersQuery(filters); let query = getFiltersQuery(filters);
if (opts.with?.includes('authors')) { if (opts.extra?.includes('author')) {
query = query query = query
.leftJoin( .leftJoin(
(eb) => (eb) =>

View File

@ -8,8 +8,8 @@ interface DittoFilter<K extends number = number> extends Filter<K> {
local?: boolean; local?: boolean;
} }
/** Additional properties that may be added to events. */ /** Additional properties that may be added by Ditto to events. */
type With = 'authors'; type Extra = 'author';
/** Additional options to apply to the whole subscription. */ /** Additional options to apply to the whole subscription. */
interface GetFiltersOpts { interface GetFiltersOpts {
@ -18,7 +18,7 @@ interface GetFiltersOpts {
/** Event limit for the whole subscription. */ /** Event limit for the whole subscription. */
limit?: number; limit?: number;
/** Whether to include a corresponding kind 0 event in the `authors` key of each event. */ /** Whether to include a corresponding kind 0 event in the `authors` key of each event. */
with?: With[]; extra?: Extra[];
} }
function matchDittoFilter(filter: DittoFilter, event: Event, data: EventData): boolean { function matchDittoFilter(filter: DittoFilter, event: Event, data: EventData): boolean {