mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
updating format of text when creating logs for document uploads
This commit is contained in:
parent
3a60a4bd91
commit
20e5eaff9a
2 changed files with 1 additions and 13 deletions
|
|
@ -60,9 +60,6 @@ export async function POST(req: NextRequest) {
|
|||
if (body.hubspotDealId) {
|
||||
void syncContractorDocUploadToHubSpot({
|
||||
hubspotDealId: body.hubspotDealId,
|
||||
fileType: body.fileType ?? null,
|
||||
measureName: body.measureName ?? null,
|
||||
uploadedByEmail: session.user.email,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,22 +39,13 @@ export async function syncRemovalRequestToHubSpot(params: {
|
|||
|
||||
export async function syncContractorDocUploadToHubSpot(params: {
|
||||
hubspotDealId: string;
|
||||
fileType: string | null;
|
||||
measureName: string | null;
|
||||
uploadedByEmail: string;
|
||||
}): Promise<void> {
|
||||
try {
|
||||
const client = getHubSpotClient();
|
||||
|
||||
const log = [
|
||||
`File type: ${params.fileType ?? "unclassified"}`,
|
||||
`Measure: ${params.measureName ?? "N/A"}`,
|
||||
`Uploaded by: ${params.uploadedByEmail}`,
|
||||
].join("\n");
|
||||
|
||||
await client.crm.deals.basicApi.update(params.hubspotDealId, {
|
||||
properties: {
|
||||
contractor_document_upload_log: log,
|
||||
contractor_document_upload_log: "Documents available - uploaded by contractor",
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue