Open Closed

Generation of Service Proxies for Angular not handling DateOnly properties correctly #5965


User avatar
0
dmannion created

After running abp generate-proxy -t ng, DTO properties that have a data type of DateOnly become "any" data type in the resulting TypeScript interfaces. In addition, it creates a system/models.ts as this:

export interface any extends any {
  minValue: any;
  maxValue: any;
  year: number;
  month: number;
  day: number;
  dayOfWeek: any;
  dayOfYear: number;
  dayNumber: number;
}

This results in the following error when trying to run the angular app:

Error: src/app/proxy/system/models.ts:2:18 - error TS2310: Type 'any' recursively references itself as a base type.

2 export interface any extends any { ~~~

Error: src/app/proxy/system/models.ts:2:18 - error TS2427: Interface name cannot be 'any'.

2 export interface any extends any {

DateOnly properties should be treated as strings in TypeScript since the .NET JSON Serializer natively supports writing DateOnly to/from string in the "yyyy-mm-dd" format.

  • ABP CLI version: v7.3.3 and v7.4.4
  • ABP Framework version: v7.3.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server,
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi

    We will fix this issue, for now please use datetime and convert it to dateonly in the backend

  • User Avatar
    0
    masum.ulu created
    Support Team Angular Expert

    Hello we've created issue https://github.com/abpframework/abp/issues/17923 we'll fix. I'll refund your credit after reproduce

  • User Avatar
    0
    masum.ulu created
    Support Team Angular Expert

    https://github.com/abpframework/abp/pull/17981 here's PR

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38