fix: remove check length for the notif settings
This commit is contained in:
+3
-3
@@ -7,13 +7,13 @@ import { ConfigModule } from "@nestjs/config";
|
||||
import { ThrottlerModule } from "@nestjs/throttler";
|
||||
import { TypeOrmModule } from "@nestjs/typeorm";
|
||||
import { MailerModule } from "@nestjs-modules/mailer";
|
||||
import { TelegrafModule } from "nestjs-telegraf";
|
||||
// import { TelegrafModule } from "nestjs-telegraf";
|
||||
|
||||
import { bullMqConfig } from "./configs/bullmq.config";
|
||||
import { cacheConfig } from "./configs/cache.config";
|
||||
import { mailerConfig } from "./configs/mailer.config";
|
||||
import { rateLimitConfig } from "./configs/rateLimit.config";
|
||||
import { telegrafConfig } from "./configs/telegraf.config";
|
||||
// import { telegrafConfig } from "./configs/telegraf.config";
|
||||
import { databaseConfigs } from "./configs/typeorm.config";
|
||||
import { HTTPLogger } from "./core/middlewares/logger.middleware";
|
||||
import { AddressModule } from "./modules/address/address.module";
|
||||
@@ -43,7 +43,7 @@ import { MonitoringModule } from "./monitoring/monitoring.module";
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TelegrafModule.forRootAsync(telegrafConfig()),
|
||||
// TelegrafModule.forRootAsync(telegrafConfig()),
|
||||
MailerModule.forRootAsync(mailerConfig()),
|
||||
BullModule.forRootAsync(bullMqConfig()),
|
||||
ThrottlerModule.forRootAsync(rateLimitConfig()),
|
||||
|
||||
@@ -79,7 +79,8 @@ export class AuthService {
|
||||
await this.notificationService.createNewCustomerNotification(
|
||||
admin.id,
|
||||
{
|
||||
userPhone: user.phone,
|
||||
userPhone: admin.phone,
|
||||
userEmail: admin.email,
|
||||
fullName: `${user.firstName} ${user.lastName}`,
|
||||
mobile: user.phone,
|
||||
},
|
||||
|
||||
@@ -264,8 +264,8 @@ export class BlogsService {
|
||||
await this.notificationsService.createNewBlogCommentNotification(
|
||||
admin.id,
|
||||
{
|
||||
userPhone: user.phone,
|
||||
userEmail: user.email,
|
||||
userPhone: admin.phone,
|
||||
userEmail: admin.email,
|
||||
blogTitle: blog.title,
|
||||
fullName: `${user.firstName} ${user.lastName}`,
|
||||
},
|
||||
|
||||
@@ -23,6 +23,9 @@ export class CriticismsService {
|
||||
async create(createDto: CreateCriticismDto, userId: string) {
|
||||
const queryRunner = this.dataSource.createQueryRunner();
|
||||
try {
|
||||
await queryRunner.connect();
|
||||
await queryRunner.startTransaction();
|
||||
|
||||
const user = await this.usersService.findOneByIdWithQueryRunner(userId, queryRunner);
|
||||
const files =
|
||||
createDto.files?.map((file) => {
|
||||
@@ -102,8 +105,8 @@ export class CriticismsService {
|
||||
admin.id,
|
||||
{
|
||||
fullName: `${criticism.user.firstName} ${criticism.user.lastName}`,
|
||||
userPhone: criticism.user.phone,
|
||||
userEmail: criticism.user.email,
|
||||
userPhone: admin.phone,
|
||||
userEmail: admin.email,
|
||||
title: criticism.title,
|
||||
},
|
||||
queryRunner,
|
||||
|
||||
@@ -529,8 +529,8 @@ export class DanakServicesService {
|
||||
admin.id,
|
||||
{
|
||||
serviceName: service.name,
|
||||
userPhone: user.phone,
|
||||
userEmail: user.email,
|
||||
userPhone: admin.phone,
|
||||
userEmail: admin.email,
|
||||
fullName: `${user.firstName} ${user.lastName}`,
|
||||
},
|
||||
queryRunner,
|
||||
|
||||
@@ -348,8 +348,8 @@ export class InvoiceProcessor extends WorkerProcessor {
|
||||
admin.id,
|
||||
{
|
||||
date: invoice.dueDate,
|
||||
userPhone: invoice.user.phone,
|
||||
userEmail: invoice.user.email,
|
||||
userPhone: admin.phone,
|
||||
userEmail: admin.email,
|
||||
serviceName: invoice.items[0]?.subscriptionPlan?.plan.service.name ?? "",
|
||||
fullName: invoice.user.firstName + " " + invoice.user.lastName,
|
||||
},
|
||||
|
||||
@@ -21,7 +21,8 @@ export class UserSettingsService {
|
||||
where: { type: In(Object.values(NotifType)) },
|
||||
});
|
||||
|
||||
if (notifSettings.length !== Object.values(NotifType).length) throw new BadRequestException(SettingMessageEnum.NOTIF_NOT_FOUND);
|
||||
//TODO: remove this after testing
|
||||
// if (notifSettings.length !== Object.values(NotifType).length) throw new BadRequestException(SettingMessageEnum.NOTIF_NOT_FOUND);
|
||||
|
||||
const userSettings = notifSettings.map((notifSetting) =>
|
||||
queryRunner.manager.create(UserSetting, {
|
||||
|
||||
@@ -433,8 +433,8 @@ export class TicketsService {
|
||||
{
|
||||
ticketId: ticket.numericId.toString(),
|
||||
ticketSubject: ticket.subject,
|
||||
userPhone: ticket.user.phone,
|
||||
userEmail: ticket.user.email,
|
||||
userPhone: admin.phone,
|
||||
userEmail: admin.email,
|
||||
fullName: `${ticket.user.firstName} ${ticket.user.lastName}`,
|
||||
},
|
||||
queryRunner,
|
||||
|
||||
Reference in New Issue
Block a user