Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bytes return BytesDto #64

Open
dwcahyo23 opened this issue Feb 18, 2025 · 3 comments
Open

Bytes return BytesDto #64

dwcahyo23 opened this issue Feb 18, 2025 · 3 comments

Comments

@dwcahyo23
Copy link

hi @Brakebein i used @brakebein/prisma-generator-nestjs-dto": "^1.24.1", then I found the problem "Cannot find name 'BytesDto'".

model AcipImprovementFiles {
    id   Int    @id @default(autoincrement())
    kind String
    file Bytes
    /// @DtoRelationIncludeId
    acipImprovementId Int             @map("acip_improvement_id")
    acipImprovement   AcipImprovement @relation(fields: [acipImprovementId], references: [id])
}

return file type is BytesDto

 @ApiProperty({
    type: () => BytesDto,
  })
  file!: Buffer;
@Brakebein
Copy link
Owner

I have indeed overlooked the Bytes type for the ApiProperty decorator.

The correct type should then look as follows?

 @ApiProperty({
    type: 'string',
    format: 'binary',
  })
  file!: Buffer;

@dwcahyo23
Copy link
Author

yes exactly, file!: Buffer

Brakebein added a commit that referenced this issue Mar 7, 2025
@Brakebein
Copy link
Owner

It's fixed in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants