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

support nullable domain-value-object reference #11

Open
uladkasach opened this issue Dec 8, 2022 · 1 comment
Open

support nullable domain-value-object reference #11

uladkasach opened this issue Dec 8, 2022 · 1 comment

Comments

@uladkasach
Copy link
Member

right now, in the upsert function, it is trying to resolve the domain value object id without checking if the input for that property was null

typescript is catching this so no biggie, but its making the user have to fix it themselves

@uladkasach
Copy link
Member Author

uladkasach commented Dec 9, 2022

e.g.,
from

      searchTermId: googleAdsExposureTrigger.searchTerm.id
        ? googleAdsExposureTrigger.searchTerm.id
        : (
            await googleAdsSearchTermDao.upsert({
              dbConnection,
              googleAdsSearchTerm: googleAdsExposureTrigger.searchTerm,
            })
          ).id,

to

      searchTermId: googleAdsExposureTrigger.searchTerm
        ? googleAdsExposureTrigger.searchTerm.id
          ? googleAdsExposureTrigger.searchTerm.id
          : (
              await googleAdsSearchTermDao.upsert({
                dbConnection,
                googleAdsSearchTerm: googleAdsExposureTrigger.searchTerm,
              })
            ).id
        : null,

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

1 participant