nestjs-paginate icon indicating copy to clipboard operation
nestjs-paginate copied to clipboard

Add test for nullSort with relations issue

Open AliRezaBeitari opened this issue 7 months ago • 0 comments
trafficstars

Added test case to demonstrate the TypeError that occurs when using nullSort with relations. The test uses CatEntity and its toys relation to replicate the issue where attempting to sort null values with loaded relations causes: TypeError: Cannot read properties of undefined (reading 'databaseName')

The test verifies that:

  • nullSort: 'last' configuration works with relations loaded
  • Entities are properly ordered with null values last
  • Relations are maintained in the sorted results
  • The toys relation is properly loaded and cleaned of circular references

Related issue: https://github.com/ppetzold/nestjs-paginate/issues/1017

AliRezaBeitari avatar Mar 22 '25 07:03 AliRezaBeitari