mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
chore(server): lint:boundaries holds the user-connection repositories and the journey read at their new count
The module comment no longer spells an @InjectRepository call the scanner took for a foreign Users injection in nest/database, and journey's Users entry is gone now that it reads the Immich flag through UserImmichRepository.
This commit is contained in:
@@ -196,7 +196,6 @@
|
||||
"integrations -> Users (owned by auth)",
|
||||
"journey -> Places (owned by places)",
|
||||
"journey -> Trips (owned by trips)",
|
||||
"journey -> Users (owned by auth)",
|
||||
"llm-parse -> Addons (owned by addons)",
|
||||
"maps -> AppSettings (owned by settings)",
|
||||
"maps -> Places (owned by places)",
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { EntityManager } from '@mikro-orm/core';
|
||||
import { UserAirtrailRepository } from '../../db/repositories/UserAirtrail.repository';
|
||||
import { UserImmichRepository } from '../../db/repositories/UserImmich.repository';
|
||||
import { UserSynologyRepository } from '../../db/repositories/UserSynology.repository';
|
||||
import { EntityManager } from '@mikro-orm/core';
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
/**
|
||||
* Provides the repositories for the third-party connections a user keeps on
|
||||
* their own `users` row (Immich, Synology Photos, AirTrail). They share the
|
||||
* `users` table with `UsersRepository`, so MikroORM's one-repository-per-entity
|
||||
* `@InjectRepository(Users)` cannot hand them out; each is a factory over the
|
||||
* injection for the `Users` entity cannot hand them out; each is a factory over the
|
||||
* context-resolving global `EntityManager`, as `MaintenanceModule` does, so it
|
||||
* resolves the request or transaction fork active when a method runs.
|
||||
*/
|
||||
@Module({
|
||||
providers: [
|
||||
{ provide: UserImmichRepository, useFactory: (em: EntityManager) => new UserImmichRepository(em), inject: [EntityManager] },
|
||||
{ provide: UserSynologyRepository, useFactory: (em: EntityManager) => new UserSynologyRepository(em), inject: [EntityManager] },
|
||||
{ provide: UserAirtrailRepository, useFactory: (em: EntityManager) => new UserAirtrailRepository(em), inject: [EntityManager] },
|
||||
{
|
||||
provide: UserImmichRepository,
|
||||
useFactory: (em: EntityManager) => new UserImmichRepository(em),
|
||||
inject: [EntityManager],
|
||||
},
|
||||
{
|
||||
provide: UserSynologyRepository,
|
||||
useFactory: (em: EntityManager) => new UserSynologyRepository(em),
|
||||
inject: [EntityManager],
|
||||
},
|
||||
{
|
||||
provide: UserAirtrailRepository,
|
||||
useFactory: (em: EntityManager) => new UserAirtrailRepository(em),
|
||||
inject: [EntityManager],
|
||||
},
|
||||
],
|
||||
exports: [UserImmichRepository, UserSynologyRepository, UserAirtrailRepository],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user