Skip to content

Commit

Permalink
feat: introduced sync between directory to forum
Browse files Browse the repository at this point in the history
  • Loading branch information
navneethkrish committed Jun 11, 2024
1 parent 529c65e commit bdb26cd
Show file tree
Hide file tree
Showing 4 changed files with 848 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ import { UniqueIdentifier } from './unique-identifier/unique-identifier.controll
import { RedisService } from '../utils/redis/redis.service';
import { SlackService } from '../utils/slack/slack.service';
import { ForestAdminService } from '../utils/forest-admin/forest-admin.service';
import { SqsModule } from '@ssut/nestjs-sqs';
@Module({
imports: [],
imports: [
SqsModule.register({
producers: [
{
name: process.env.QUEUE || '', // name of the queue
queueUrl: process.env.QUEUE_URL || '', // the url of the queue
region: process.env.AWS_REGION,
}
]
})
],
controllers: [ParticipantsRequestController, UniqueIdentifier],
providers: [
ParticipantsRequestService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import axios from 'axios';
import { LogService } from '../shared/log.service';
import { Cache } from 'cache-manager';
import { DEFAULT_MEMBER_ROLES } from '../utils/constants';
import { SqsService, SqsMessageHandler } from '@ssut/nestjs-sqs';
import { v4 as uuid } from 'uuid';

@Injectable()
export class ParticipantsRequestService {
Expand All @@ -38,6 +40,7 @@ export class ParticipantsRequestService {
private forestAdminService: ForestAdminService,
private logger: LogService,
@Inject(CACHE_MANAGER) private cacheService: Cache,
private sqsService: SqsService
) {}

async getAll(userQuery) {
Expand Down Expand Up @@ -530,7 +533,14 @@ export class ParticipantsRequestService {
transactionType
);
}

await this.sqsService.send(process.env.QUEUE || '',
{
id: uuid(),
body: {
memberUid: dataFromDB.uid
}
}
);
if (!disableNotification) {
await this.awsService.sendEmail('MemberEditRequestCompleted', true, [], {
memberName: dataToProcess.name,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@radix-ui/react-tooltip": "^1.0.0",
"@sentry/minimal": "^6.19.7",
"@sentry/nextjs": "^7.8.1",
"@ssut/nestjs-sqs": "2.1.0",
"@swc/helpers": "^0.4.11",
"@ts-rest/core": "^3.19.3",
"@ts-rest/nest": "^3.19.3",
Expand Down
Loading

0 comments on commit bdb26cd

Please sign in to comment.