website refactor
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { ContainerModule } from 'inversify';
|
||||
import { TEAM_SERVICE_TOKEN, TEAM_API_CLIENT_TOKEN } from '../tokens';
|
||||
import { TEAM_SERVICE_TOKEN, TEAM_JOIN_SERVICE_TOKEN } from '../tokens';
|
||||
import { TeamService } from '@/lib/services/teams/TeamService';
|
||||
import { TeamsApiClient } from '@/lib/api/teams/TeamsApiClient';
|
||||
import { TeamJoinService } from '@/lib/services/teams/TeamJoinService';
|
||||
|
||||
export const TeamModule = new ContainerModule((options) => {
|
||||
const bind = options.bind;
|
||||
|
||||
bind(TEAM_SERVICE_TOKEN)
|
||||
.toDynamicValue((ctx) => {
|
||||
const apiClient = ctx.get<TeamsApiClient>(TEAM_API_CLIENT_TOKEN);
|
||||
return new TeamService(apiClient);
|
||||
})
|
||||
.to(TeamService)
|
||||
.inSingletonScope();
|
||||
|
||||
bind(TEAM_JOIN_SERVICE_TOKEN)
|
||||
.to(TeamJoinService)
|
||||
.inSingletonScope();
|
||||
});
|
||||
Reference in New Issue
Block a user