fvtt-fria-ligan / forbidden-lands-foundry-vtt

This is a Forbidden Lands game System for the Foundry Virtual Tabletop. Made by @Perfectro, @patrys and @aMediocreDad. Maintained by @aMediocreDad
https://foundryvtt.com/packages/forbidden-lands/
Other
40 stars 43 forks source link

Item.implementation.create returns undefined #373

Closed Haxxer closed 1 year ago

Haxxer commented 1 year ago

Describe the bug

I am creating a new temporary item with Item.implementation.create and it returns a promise that resolves to undefined, regardless if it is a temporary item or not.

It would be ideal if it could resolve to the newly created item, as modules may need to store these items and use them in subsequent calls.

Reproduction

  1. In the console, run:
    Item.implementation.create({ name: "Test item", type: "armor" }, { temporary: true })
  2. It returns a promise that resolves into undefined
  3. In the console, run:
    Item.implementation.create({ name: "Test item", type: "armor" })
  4. It returns a promise that resolves into undefined, but an item was still created

System Info

OS: Windows (NodeJS self hosted)
Client: Chrome
Foundry Version: 11.304

Logs

No response

Validations