queryfailederror: invalid input syntax for type, nest js uuid:
/**
* Get all posts from all users
post controller.ts
*/
@Get('find')
@ApiCreatedResponse({
status: 201,
description: 'All posts have been successfully retreived.',
type: [PostDTO],
})
@ApiResponse({ status: 403, description: 'Forbidden.' })
async find() {
try {
return this.postService.findAll();
} catch (error) {
throw new Error(error);
}
}
/**
* Find all posts
post service.ts
*/
async findAll(): Promise<Post[]> {
const posts = await this.postRepository.find();
return posts;
}