-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove filter in project service as not needed
- Loading branch information
1 parent
20c57fa
commit 239a985
Showing
1 changed file
with
1 addition
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,28 +124,14 @@ export class ProjectsService { | |
'[email protected]': `/contacts(${attributes._dcp_applicantadministrator_customer_value})`, | ||
}; | ||
|
||
const { records } = await this.crmService.get( | ||
'dcp_projects', | ||
// 3e5 = created within 5 minutes | ||
` | ||
$filter= | ||
dcp_projectname eq '${encodeURIComponent(data.dcp_projectname)}' | ||
and createdon ge '${new Date(Date.now() - 3e5).toISOString()}' | ||
` | ||
) | ||
|
||
console.debug('LOGGER: crm records', records); | ||
if (records.length > 0) throw new Error('Project already exists'); | ||
|
||
const project = await this.crmService.create('dcp_projects', data); | ||
// console.debug("LOGGER: (service) project", project); | ||
|
||
const dcpProjectId = project['dcp_projectid']; | ||
if (dcpProjectId === undefined) throw new Error('Failed to create project'); | ||
|
||
const artifact = | ||
await this.artifactService.createProjectInitiationArtifacts(dcpProjectId); | ||
|
||
// console.debug('LOGGER: (service) artifact', artifact); | ||
const dcpArtifactsId = artifact['dcp_artifactsid']; | ||
if (dcpArtifactsId === undefined) throw new Error('Failed to create artifact for project'); | ||
|
||
|