There is no function to use an Item to create a new item
ashok-ayyarchamy opened this issue · 3 comments
It would be great to have a method from the object to save or create a new object or atleast update itself
Example:
const item = miroapi.getitem(id)
delete item.id
item.create(boardId or parentid)
what folder or file can i go to implement this ?
I would suggest under miro-api/highlevel/Board.ts & miro-api/highlevel/FrameItem.ts
a function something that does
const sourceBoard = miroApi.getBoard(sourceBoardId)
const targetBoard = miroApi.getBoard(targetBoardId)
const item = sourceBoard.getItemById( itemId )
targetBoard.copyItem( item ) // this way its easy to allow modifications to the item before copied.
similarly for frame
const targetFrame = targetBoard.getFrameItem(farmeId)
targetFrame.copyItem( item ) // hence this would create a copy of the item with targetFrame as is parent
@ashok-ayyarchamy alright ill see what i can do.