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

There is no function to use an Item to create a new item #258

Open
ashok-ayyarchamy opened this issue Oct 17, 2023 · 3 comments
Open

There is no function to use an Item to create a new item #258

ashok-ayyarchamy opened this issue Oct 17, 2023 · 3 comments

Comments

@ashok-ayyarchamy
Copy link

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)

@HermanBide
Copy link

what folder or file can i go to implement this ?

@ashok-ayyarchamy
Copy link
Author

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

@HermanBide
Copy link

@ashok-ayyarchamy alright ill see what i can do.

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