Opportunity fields (#744)

* Add opportunity probability and point of contact

* Have requests sent properly

* Add probaility field
This commit is contained in:
Emilien Chauvet
2023-07-18 17:32:15 -07:00
committed by GitHub
parent 87a116d369
commit f98e49c26e
7 changed files with 139 additions and 21 deletions

View File

@ -68,6 +68,20 @@ export class PipelineProgressResolver {
@PrismaSelector({ modelName: 'PipelineProgress' })
prismaSelect: PrismaSelect<'PipelineProgress'>,
): Promise<Partial<PipelineProgress> | null> {
// TODO: Do a proper check with recursion testing on args in a more generic place
for (const key in args.data) {
if (args.data[key]) {
for (const subKey in args.data[key]) {
if (JSON.stringify(args.data[key][subKey]) === '{}') {
delete args.data[key][subKey];
}
}
}
if (JSON.stringify(args.data[key]) === '{}') {
delete args.data[key];
}
}
return this.pipelineProgressService.update({
where: args.where,
data: args.data,