Skip to content

Commit 6d8c42e

Browse files
committed
hotfix(condo): DOMA-10973 add skip deletedAt (#5698)
(cherry picked from commit dcf73e8)
1 parent cab9a2f commit 6d8c42e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

apps/condo/domains/ticket/utils/serverSchema/TicketDocumentGeneration/completionWorks.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const dayjs = require('dayjs')
22
const { get } = require('lodash')
33

4-
const { getById, getByCondition } = require('@open-condo/keystone/schema')
4+
const { getByCondition } = require('@open-condo/keystone/schema')
55
const { i18n } = require('@open-condo/locales/loader')
66

77
const { buildExportFile, DOCX_FILE_META } = require('@condo/domains/common/utils/createExportFile')
@@ -40,17 +40,25 @@ const generateTicketDocumentOfCompletionWorks = async ({ task, baseAttrs, contex
4040
const timeZone = normalizeTimeZone(timeZoneFromUser) || DEFAULT_ORGANIZATION_TIMEZONE
4141
const printDate = dayjs().tz(timeZone).locale(locale)
4242

43-
const property = await getById('Property', ticket.property)
43+
const property = await getByCondition('Property', {
44+
id: ticket.property,
45+
deletedAt: null,
46+
})
47+
4448
const { renderData, streetPart, settlement, cityType, cityName, houseName, block } = getAddressDetails(get(property, 'addressMeta', ticket.propertyAddressMeta))
4549

4650
const contact = ticket.contact
47-
? await getById('Contact', ticket.contact)
51+
? await getByCondition('Contact', {
52+
id: ticket.contact,
53+
deletedAt: null,
54+
})
4855
: null
4956

5057
const employee = organization.id && ticket.executor
5158
? await getByCondition('OrganizationEmployee', {
52-
organization: { id: organization.id },
53-
user: { id: ticket.executor },
59+
organization: { id: organization.id, deletedAt: null },
60+
user: { id: ticket.executor, deletedAt: null },
61+
deletedAt: null,
5462
})
5563
: null
5664

0 commit comments

Comments
 (0)