fix : error 500 product api

This commit is contained in:
2026-03-30 10:55:15 +03:00
parent 648e5c213f
commit 06300e93ae
4 changed files with 143 additions and 7 deletions

View File

@@ -616,7 +616,12 @@ export class ProductsService {
.applyCalculatedPriceSelect( .applyCalculatedPriceSelect(
this.createFilteredProductsQuery(filters, false) this.createFilteredProductsQuery(filters, false)
.select('product.id', 'product_id') .select('product.id', 'product_id')
.distinct(true) .addSelect('product.featured', 'product_featured')
.addSelect('product.createdAt', 'product_created_at')
.groupBy('product.id')
.addGroupBy('product.featured')
.addGroupBy('product.createdAt')
.addGroupBy('product.basePriceUSD')
.skip((page - 1) * limit) .skip((page - 1) * limit)
.take(limit), .take(limit),
pricingContext, pricingContext,

View File

@@ -35,17 +35,17 @@ export class UserAddress {
@Column({ length: 100 }) @Column({ length: 100 })
city: string; city: string;
@Column({ name: 'postal_code', length: 20, nullable: true }) @Column({ name: 'postal_code', type: 'varchar', length: 20, nullable: true })
postalCode?: string | null; postalCode?: string;
@Column({ name: 'address_line', type: 'varchar', length: 500 }) @Column({ name: 'address_line', type: 'varchar', length: 500 })
addressLine: string; addressLine: string;
@Column({ length: 50, nullable: true }) @Column({ type: 'varchar', length: 50, nullable: true })
plaque?: string | null; plaque?: string;
@Column({ length: 50, nullable: true }) @Column({ type: 'varchar', length: 50, nullable: true })
unit?: string | null; unit?: string;
@Column({ type: 'boolean', name: 'is_default', default: false }) @Column({ type: 'boolean', name: 'is_default', default: false })
isDefault: boolean; isDefault: boolean;

27
tmp-api.err Normal file
View File

@@ -0,0 +1,27 @@
(node:23488) DeprecationWarning: Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[Nest] 23488 - 03/30/2026, 10:11:06 AM  ERROR [RedisCacheService] Redis error: connect ECONNREFUSED 185.208.181.133:30669
[Nest] 23488 - 03/30/2026, 10:11:06 AM  ERROR [RedisCacheService] Redis connection failed. Caching disabled. Connection is closed.
[Nest] 23488 - 03/30/2026, 10:11:06 AM  ERROR [NestApplication] Error: listen EADDRINUSE: address already in use :::3000 +4ms
node:net:1939
const ex = new UVExceptionWithHostPort(err, 'listen', address, port);
^
Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (node:net:1939:16)
at listenInCluster (node:net:1996:12)
at Server.listen (node:net:2101:7)
at ExpressAdapter.listen (F:\WorkSpace\website\parsshop\parsshop-back\node_modules\@nestjs\platform-express\adapters\express-adapter.js:127:32)
at F:\WorkSpace\website\parsshop\parsshop-back\node_modules\@nestjs\core\nest-application.js:188:30
at new Promise (<anonymous>)
at NestApplication.listen (F:\WorkSpace\website\parsshop\parsshop-back\node_modules\@nestjs\core\nest-application.js:178:16)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async bootstrap (F:\WorkSpace\website\parsshop\parsshop-back\dist\main.js:61:5) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '::',
port: 3000
}
Node.js v22.15.1

104
tmp-api.out Normal file
View File

@@ -0,0 +1,104 @@
> parsshop-back@0.1.0 start:prod
> node dist/main
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [NestFactory] Starting Nest application...
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] TypeOrmModule dependencies initialized +32ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] PassportModule dependencies initialized +1ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] AppModule dependencies initialized +4ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] ConfigModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] ConfigModule dependencies initialized +1ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] StorageModule dependencies initialized +43ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] RedisCacheModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:02 AM  LOG [InstanceLoader] JwtModule dependencies initialized +4ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +1413ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] PricingModule dependencies initialized +2ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] UsersModule dependencies initialized +4ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] MediaModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] SettingsModule dependencies initialized +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] AuthModule dependencies initialized +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [InstanceLoader] CatalogModule dependencies initialized +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] AppController {/api}: +77ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/health, GET} route +3ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] UsersController {/api/users}: +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me, GET} route +2ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me, PATCH} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/dashboard, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/wallet, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/wallet/transactions, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/sessions, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/sessions/:sessionId, DELETE} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/addresses, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/addresses, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/addresses/:addressId, PATCH} route +3ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/addresses/:addressId/default, PATCH} route +2ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/addresses/:addressId, DELETE} route +2ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/favorites, GET} route +4ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/favorites/:productId, POST} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/users/me/favorites/:productId, DELETE} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] SettingsController {/api/admin/settings}: +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/settings/pricing, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/settings/pricing, PATCH} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] AuthController {/api/auth}: +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/auth/otp/request, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/auth/register/password, POST} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/auth/login/password, POST} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/auth/otp/verify, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/auth/refresh, POST} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/auth/logout, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/auth/me/admin-check, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] CategoryController {/api/categories}: +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/categories, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/categories, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/categories/:id, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/categories/:id, PATCH} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/categories/:id, DELETE} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] BrandController {/api/brands}: +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/brands, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/brands, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/brands/:id, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/brands/:id, PATCH} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/brands/:id, DELETE} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] ProductsController {/api/products}: +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products/brands/:brandSlug, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products/brands/:brandSlug/filters, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products/categories/:categorySlug, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products/categories/:categorySlug/filters, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products/:id/reviews, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products/:id/reviews, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/products/:id, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] ProductDetailsController {/api/product}: +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/product/:slug, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] AdminProductsController {/api/admin/products}: +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/check-slug, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/reviews/list, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/reviews/:reviewId, PATCH} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/reviews/:reviewId, DELETE} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/:id, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/:id/price, PATCH} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/prices/bulk, PATCH} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/:id, PATCH} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/products/:id, DELETE} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] AttributeDefinitionsController {/api/admin/product-attributes}: +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/product-attributes, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/product-attributes, POST} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/product-attributes/:id, PATCH} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/product-attributes/:id, DELETE} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RoutesResolver] MediaController {/api/admin/media}: +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/media/overview, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/media, GET} route +0ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/media/upload, POST} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/media/:id, GET} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/media/:id, PATCH} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:03 AM  LOG [RouterExplorer] Mapped {/api/admin/media/:id, DELETE} route +1ms
[Nest] 23488 - 03/30/2026, 10:11:06 AM  LOG [NestApplication] Nest application successfully started +798ms