I have gone through this post but I am still struggling to understand the issue. Why am I unable to pass this array to the update call?
// create a new object with updated post properties
const newPost = await this.postRepository.create(data);
await this.postRepository.save(newPost);
// add post id to the posts array
const posts = [];
posts.push({
post_id: newPost.post_id,
title: newPost.title,
});
const updatedUser = {
posts,
};
// update user to include the posts array
await this.userService.edit(data.user_id, updatedUser); // getting error on updatedUser
export interface UserDTO {
user_id: string;
name: string;
posts: [
{
post_id: string;
title: string;
},
];
}