fix bug of edit product

This commit is contained in:
2026-09-30 21:16:29 +03:30
parent 38cabb0957
commit be00478aa4
15 changed files with 150 additions and 119 deletions
+6 -7
View File
@@ -24,7 +24,7 @@ export class CompaniesService {
orderBy: [{ displayOrder: 'asc' }, { name: 'asc' }],
include: {
_count: {
select: { catalogs: true, products: true, bankAccounts: true },
select: { products: true, bankAccounts: true },
},
},
}),
@@ -40,7 +40,7 @@ export class CompaniesService {
include: {
bankAccounts: { orderBy: { displayOrder: 'asc' } },
_count: {
select: { catalogs: true, products: true, bankAccounts: true },
select: { products: true, bankAccounts: true },
},
},
}),
@@ -78,7 +78,7 @@ export class CompaniesService {
},
include: {
_count: {
select: { catalogs: true, products: true, bankAccounts: true },
select: { products: true, bankAccounts: true },
},
},
});
@@ -116,7 +116,7 @@ export class CompaniesService {
},
include: {
_count: {
select: { catalogs: true, products: true, bankAccounts: true },
select: { products: true, bankAccounts: true },
},
},
});
@@ -139,7 +139,7 @@ export class CompaniesService {
data: { isActive },
include: {
_count: {
select: { catalogs: true, products: true, bankAccounts: true },
select: { products: true, bankAccounts: true },
},
},
});
@@ -226,7 +226,7 @@ export class CompaniesService {
cashInvoiceValidUntilHour: number | null;
createdAt: Date;
updatedAt: Date;
_count?: { catalogs: number; products: number; bankAccounts: number };
_count?: { products: number; bankAccounts: number };
},
fallbackMaxMeterage: number | null = null,
) {
@@ -247,7 +247,6 @@ export class CompaniesService {
ownMaxMeteragePerInvoice: company.maxMeteragePerInvoice ?? undefined,
cashInvoiceValidityHours: company.cashInvoiceValidityHours,
cashInvoiceValidUntilHour: company.cashInvoiceValidUntilHour ?? undefined,
catalogCount: company._count?.catalogs ?? 0,
productCount: company._count?.products ?? 0,
bankAccountCount: company._count?.bankAccounts ?? 0,
createdAt: company.createdAt.toISOString(),