I am trying to provide some arguments for a particular json object but I keep seeing this error:
Object literal may only specify known properties, and 'createdData' does not exist in type '{ bookId: string; createdBooks: []; }[]
I don’t really understand the layout of this method below so just wanted to ask how the argument should be populated. It’s the [] that throws me at the end of this method
export async function settleBooks(
createdData: { bookId: string; createdBooks: [] }[],
) {
for (const book of createdData) {
await settleBooksResulted(book.bookId, book.createdBooks);
}
}
Below is how I am calling the method with the object included:
const books = await settleBooks({
createdData: {
bookId: '8e3e7878-da38-43f4-a033-8cd9e37fa5c3',
createdBooks: [
{
booksCreated: [
{
bookId: '8e3e7878-da38-43f4-a033-8cd9e37fa5c3',
selectionId: 'd9767337-f9f6-4d05-83f4-48d5440eaa9b',
},
],
},
],
},
});