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

When creating, updating, or deleting embedded documents within a parent Document that exists inside a Compendium pack, automatically infer the pack from the parent document. #5937

Closed
aaclayton opened this issue Sep 27, 2021 · 0 comments
Assignees
Labels
api Issues related to the API used by Mod Devs

Comments

@aaclayton
Copy link
Contributor

Originally in GitLab by @ghost91-

Feature Summary

When creating a document within a parent that itself is part of a compendium pack, that pack also needs to be specified explicitly. For example, in order to create an Item within an Actor in a compendium pack, you need to do

Item.create(createData, {parent: actor, pack: actor.pack});

Having to specify the pack explicitly is redundant as it is only possible to create the embedded document inside the parent in that compendium pack anyways.

Additionally, this is already handled automatically when creating the embedded document via createEmbeddedDocuments.

In order to make this easier to use and also to harmonize the 2 ways of creating embedded documents, I suggest to infer the pack automatically from the parent if possible, in the same way that happens for createEmbeddedDocuments.

Priority/Importance

Pretty low priority as there are obvious workarounds. This is just to make the API a bit nicer / more consistent. But it should be pretty low effort, so it might be a good idea to just do it anyways.

@aaclayton aaclayton self-assigned this Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API used by Mod Devs
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant