mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 23:46:35 +00:00
test(journey): the journal link repository on its own, without the two reads nothing called
linkRecipientUserIds and listTripIdsForJourney had no caller and kept src/db/repositories under its 99 % statement floor. TJLREPO-001..007 cover the link rows, the members list, the reach across trips ending with the membership, the hide-skeletons choice of a link member, the role precedence and leaveJournalLink.
This commit is contained in:
@@ -213,24 +213,4 @@ export class TripJournalLinksRepository extends TrekRepository<TripJournalLinks>
|
||||
.where('trip_id', '=', tripId)
|
||||
.execute();
|
||||
}
|
||||
|
||||
/** Everyone a journal's links let in, for its live updates. */
|
||||
async linkRecipientUserIds(journeyId: number): Promise<number[]> {
|
||||
const rows = await linkReach(this.kysely<TripJournalLinkKyselyDB>())
|
||||
.select('m.user_id')
|
||||
.distinct()
|
||||
.where('l.journey_id', '=', journeyId)
|
||||
.execute();
|
||||
return rows.map((r) => r.user_id);
|
||||
}
|
||||
|
||||
/** The trips that show this journal, for telling their members when it changes hands. */
|
||||
async listTripIdsForJourney(journeyId: number): Promise<number[]> {
|
||||
const rows = await this.kysely<TripJournalLinkKyselyDB>()
|
||||
.selectFrom('trip_journal_links')
|
||||
.select('trip_id')
|
||||
.where('journey_id', '=', journeyId)
|
||||
.execute();
|
||||
return rows.map((r) => r.trip_id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user