Skip to content

Commit

Permalink
feat: issue 945 soft delete users (#1583)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofrparreira authored Nov 26, 2024
1 parent d9f397a commit 7c66f2c
Show file tree
Hide file tree
Showing 17 changed files with 1,123 additions and 29 deletions.
13 changes: 11 additions & 2 deletions backend/src/infrastructure/database/mongoose.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Schedules, { SchedulesSchema } from 'src/modules/schedules/entities/sched
import TeamUser, { TeamUserSchema } from 'src/modules/teamUsers/entities/team.user.schema';
import Team, { TeamSchema } from 'src/modules/teams/entities/team.schema';
import User, { UserSchema } from 'src/modules/users/entities/user.schema';
import { SoftDeletePlugin } from './plugins/soft-delete.plugin';

export const mongooseBoardModule = MongooseModule.forFeature([
{ name: Board.name, schema: BoardSchema }
Expand All @@ -17,8 +18,16 @@ export const mongooseBoardUserModule = MongooseModule.forFeature([
{ name: BoardUser.name, schema: BoardUserSchema }
]);

export const mongooseUserModule = MongooseModule.forFeature([
{ name: User.name, schema: UserSchema }
export const mongooseUserModule = MongooseModule.forFeatureAsync([
{
name: User.name,
useFactory: () => {
const schema = UserSchema;
schema.plugin(SoftDeletePlugin);

return schema;
}
}
]);

export const mongooseResetModule = MongooseModule.forFeature([
Expand Down
Loading

0 comments on commit 7c66f2c

Please sign in to comment.