Skip to content

Commit dc07b88

Browse files
committed
🧹 fix logs
1 parent 1d54f23 commit dc07b88

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/models/controller.model.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from ".";
1616
import { calendarEventsSchema, contactsSchema } from "../schemas";
1717
import { shouldSkipCallEvent } from "../util/call-event.util";
18-
import { errorLogger, infoLogger } from "../util/logger.util";
18+
import { errorLogger, infoLogger, warnLogger } from "../util/logger.util";
1919
import { parsePhoneNumber } from "../util/phone-number-utils";
2020
import { validate } from "../util/validate";
2121
import { APIContact } from "./api-contact.model";
@@ -260,7 +260,7 @@ export class Controller {
260260
}
261261

262262
infoLogger(
263-
"createContact",
263+
"updateContact",
264264
`Contact with id ${contact.id} updated`,
265265
apiKey
266266
);
@@ -333,7 +333,7 @@ export class Controller {
333333
res.status(200).send();
334334

335335
infoLogger(
336-
"createContact",
336+
"deleteContact",
337337
`Contact with id ${contactId} deleted`,
338338
apiKey
339339
);
@@ -615,11 +615,18 @@ export class Controller {
615615
req.body
616616
);
617617

618-
infoLogger(
619-
"handleCallEvent",
620-
`CallEvent with refId ${integrationCallEventRef} created!`,
621-
providerConfig.apiKey
622-
);
618+
if (integrationCallEventRef != "")
619+
infoLogger(
620+
"handleCallEvent",
621+
`CallEvent with refId ${integrationCallEventRef} created!`,
622+
providerConfig.apiKey
623+
);
624+
else
625+
warnLogger(
626+
"handleCallEvent",
627+
`Did not create callEvent`,
628+
providerConfig.apiKey
629+
);
623630

624631
infoLogger("handleCallEvent", `END`, providerConfig.apiKey);
625632
res.status(200).send(integrationCallEventRef);

0 commit comments

Comments
 (0)