mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
FEAT: new PseudoDocumentsField
FIX: BasePseudoDocument 's getEmbeddedDocument
This commit is contained in:
parent
70d8f37d3c
commit
df23847392
3 changed files with 26 additions and 3 deletions
|
|
@ -121,8 +121,8 @@ export default class BasePseudoDocument extends foundry.abstract.DataModel {
|
|||
getEmbeddedDocument(embeddedName, id, { invalid = false, strict = false } = {}) {
|
||||
const embeds = this.constructor.metadata.embedded ?? {};
|
||||
if (embeddedName in embeds) {
|
||||
const path = embeds[embeddedName];
|
||||
return foundry.utils.getProperty(this, path).get(id, { invalid, strict }) ?? null;
|
||||
const path = `${embeds[embeddedName]}.${id}`;
|
||||
return foundry.utils.getProperty(this, path) ?? null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue