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

Error: users.cart.items.product is undefined #1

Open
kimyvgy opened this issue Jun 18, 2024 · 1 comment
Open

Error: users.cart.items.product is undefined #1

kimyvgy opened this issue Jun 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kimyvgy
Copy link
Contributor

kimyvgy commented Jun 18, 2024

INFO[0041] add product to cart 500 {"statusCode":500,"error":"Internal Server Error","message":"undefined is not an object (evaluating 'p.product.toString')"}  source=console
INFO[0041] get checkout 500 {"statusCode":500,"error":"Internal Server Error","message":"undefined is not an object (evaluating 'p.product.price')"}  source=console
INFO[0041] checkout 500 {"statusCode":500,"error":"Internal Server Error","message":"undefined is not an object (evaluating 'p.product.price')"}  source=console

Actual database record:

{
  "_id": {
    "$oid": "664c0af09bad22647fc45072"
  },
  "username": "customer1",
  "password": "$argon2id$v=19$m=65536,t=2,p=1$xe7Ry9jiR7wzxP9DiD4htfcwxBfgr1ETIiW9i22depY$10L+AWJL8daLkw1Nwa+sHu3oe0ppk0SrIuJGTLUcDRM",
  "cart": {
    "items": [
      {
        "quantity": 1
      }
    ]
  },
  "createdAt": {
    "$date": "2024-05-21T02:46:08.066Z"
  },
  "updatedAt": {
    "$date": "2024-06-18T04:01:24.576Z"
  },
  "__v": 114
}
@kimyvgy kimyvgy added the bug Something isn't working label Jun 18, 2024
@kimyvgy
Copy link
Contributor Author

kimyvgy commented Jun 18, 2024

Workaround: run aggregation pipeline to clear cart:

[
  {
    "cart.items": []
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant