fix: #6909 reverted left join (deprecated)

This commit is contained in:
RAHUL RATHORE
2023-10-31 15:02:04 +05:30
parent a4045a3cf1
commit db0975faa1
6 changed files with 50 additions and 4 deletions
@@ -419,6 +419,12 @@ export class ContactsComponent extends PaginationFilterBaseComponent implements
this.smartTableSource = new ServerDataSource(this.http, {
endPoint: `${API_PREFIX}/organization-contact/pagination`,
relations: ['projects.members', 'members.user', 'tags', 'contact'],
join: {
alias: 'organization_contact',
leftJoin: {
members: 'organization_contact.members'
}
},
where: {
organizationId,
tenantId,
@@ -331,9 +331,17 @@ export class DepartmentsComponent
this.smartTableSource = new ServerDataSource(this.httpClient, {
endPoint: `${API_PREFIX}/organization-department/pagination`,
relations: ['members', 'members.user', 'tags'],
join: {
alias: 'organization_department',
leftJoin: {
tags: 'organization_department.tags'
},
...(this.filters.join ? this.filters.join : {})
},
where: {
...{ organizationId, tenantId },
...this.filters.where
tenantId,
organizationId,
...(this.filters.where ? this.filters.where : {})
},
resultMap: (department: IOrganizationDepartment) => {
return department;
@@ -260,7 +260,15 @@ export class ExpenseCategoriesComponent
this.smartTableSource = new ServerDataSource(this.httpClient, {
endPoint: `${API_PREFIX}/expense-categories/pagination`,
relations: ['tags'],
relations: [
'tags'
],
join: {
alias: 'expense_category',
leftJoin: {
tags: 'expense_category.tags'
}
},
where: {
organizationId,
tenantId,
@@ -507,6 +507,13 @@ export class IncomeComponent extends PaginationFilterBaseComponent
'organization',
'client'
],
join: {
alias: 'income',
leftJoin: {
tags: 'income.tags'
},
...(this.filters.join ? this.filters.join : {})
},
where: {
organizationId,
tenantId,
@@ -221,6 +221,14 @@ export class InvoicesReceivedComponent
this.smartTableSource = new ServerDataSource(this.httpClient, {
endPoint: `${API_PREFIX}/invoices/pagination`,
relations: ['payments', 'tags', 'toContact'],
join: {
alias: 'invoice',
leftJoin: {
tags: 'invoice.tags',
toContact: 'invoice.toContact'
},
...(this.filters.join) ? this.filters.join : {}
},
where: {
sentTo: organizationId,
tenantId,
+10 -1
View File
@@ -94,7 +94,16 @@ export abstract class CrudService<T extends BaseEntity>
const [items, total] = await this.repository.findAndCount({
skip: options && options.skip ? (options.take * (options.skip - 1)) : 0,
take: options && options.take ? (options.take) : 10,
/**
* Specifies what relations should be loaded.
*
* @deprecated
*/
...(
(options && options.join) ? {
join: options.join
} : {}
),
...(
(options && options.select) ? {
select: options.select