Skip to content

Commit

Permalink
remove campaingApplication data sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
Martbul committed Jul 16, 2024
1 parent 15849d5 commit 33777b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import { OrganizerService } from '../organizer/organizer.service'
@Module({
imports: [PrismaModule],
controllers: [CampaignApplicationController],
providers: [CampaignApplicationService,PersonService,OrganizerService],
providers: [CampaignApplicationService, PersonService, OrganizerService],
})
export class CampaignApplicationModule {}
30 changes: 15 additions & 15 deletions apps/api/src/campaign-application/campaign-application.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@ export class CampaignApplicationService {
})
}

const sanitizedData = {
campaignName: createCampaignApplicationDto.campaignName.trim(),
organizerName: createCampaignApplicationDto.organizerName.trim(),
organizerEmail: createCampaignApplicationDto.organizerEmail.trim(),
organizerPhone: createCampaignApplicationDto.organizerPhone.trim(),
beneficiary: createCampaignApplicationDto.beneficiary.trim(),
organizerBeneficiaryRel: createCampaignApplicationDto.organizerBeneficiaryRel.trim(),
goal: createCampaignApplicationDto.goal.trim(),
history: createCampaignApplicationDto.history?.trim(),
amount: createCampaignApplicationDto.amount.trim(),
description: createCampaignApplicationDto.description?.trim(),
campaignGuarantee: createCampaignApplicationDto.campaignGuarantee?.trim(),
otherFinanceSources: createCampaignApplicationDto.otherFinanceSources?.trim(),
otherNotes: createCampaignApplicationDto.otherNotes?.trim(),
const campaingApplicationData = {
campaignName: createCampaignApplicationDto.campaignName,
organizerName: createCampaignApplicationDto.organizerName,
organizerEmail: createCampaignApplicationDto.organizerEmail,
organizerPhone: createCampaignApplicationDto.organizerPhone,
beneficiary: createCampaignApplicationDto.beneficiary,
organizerBeneficiaryRel: createCampaignApplicationDto.organizerBeneficiaryRel,
goal: createCampaignApplicationDto.goal,
history: createCampaignApplicationDto.history,
amount: createCampaignApplicationDto.amount,
description: createCampaignApplicationDto.description,
campaignGuarantee: createCampaignApplicationDto.campaignGuarantee,
otherFinanceSources: createCampaignApplicationDto.otherFinanceSources,
otherNotes: createCampaignApplicationDto.otherNotes,
category: createCampaignApplicationDto.category,
organizerId: organizer.id,
}

const newCampaignApplication = await this.prisma.campaignApplication.create({
data: sanitizedData,
data: campaingApplicationData,
})

return newCampaignApplication
Expand Down

0 comments on commit 33777b4

Please sign in to comment.