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

[Bug] Cannot submit comments for ideas in staging #148

Open
chungthuang opened this issue Feb 15, 2024 · 2 comments
Open

[Bug] Cannot submit comments for ideas in staging #148

chungthuang opened this issue Feb 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@chungthuang
Copy link
Contributor

Describe the bug
Cannot submit comments for ideas in staging

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://staging.devlaunchers.org/ideaspace/workshop/254
  2. Open network tab of the browser
  3. Write a comment and try to submit it
  4. See POST https://apiv4-staging.devlaunchers.org/api/comments got a 500 response

Expected behavior
Idea is submitted

Environment
Staging website which uses the staging API

Additional context
Staging server log suggests the problem is in the lifecycle hook:

{
id: 180,
text: 'Can you provide more details?',
author: 'cthuang',
createdAt: '2024-02-15T20:22:14.175Z',
updatedAt: '2024-02-15T20:22:14.175Z',
publishedAt: '2024-02-15T20:22:14.136Z'
}
[2024-02-15 20:22:14.420] �[31merror�[39m: Cannot read properties of undefined (reading 'ideaName')
TypeError: Cannot read properties of undefined (reading 'ideaName')
at Object.afterCreate (/srv/app/src/api/comment/content-types/comment/lifecycles.js:10:56)
at modelsLifecyclesSubscriber (/srv/app/node_modules/@strapi/database/dist/index.js:5856:43)
at Object.run (/srv/app/node_modules/@strapi/database/dist/index.js:5941:17)
at Object.create (/srv/app/node_modules/@strapi/database/dist/index.js:5038:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.create (/srv/app/node_modules/@strapi/strapi/dist/services/entity-service/index.js:131:18)
at async Object.<anonymous> (/srv/app/node_modules/@strapi/strapi/dist/services/entity-service/index.js:309:18)
at async Object.create (/srv/app/node_modules/@strapi/strapi/dist/core-api/controller/collection-type.js:46:22)
at async returnBodyMiddleware (/srv/app/node_modules/@strapi/strapi/dist/services/server/compose-endpoint.js:42:18)
at async policiesMiddleware (/srv/app/node_modules/@strapi/strapi/dist/services/server/policy.js:15:5)
@chungthuang chungthuang added the bug Something isn't working label Feb 15, 2024
@becevka
Copy link
Contributor

becevka commented Feb 21, 2024

Testing through Postman.

  • Update .env and follow instructions how to start test environment in README.md
  • Login to Strapi Content Manager
  • Create new Idea Card and publish
  • In postman run POST http://localhost:1337/api/auth/local with body
 {
  "identifier": "integration-test@devlaunchers.org",
  "password": "integration-test"
}
{"data":{"author":"me","idea_card":{"id":1},"text":"more test"}}

@becevka becevka self-assigned this May 27, 2024
@becevka
Copy link
Contributor

becevka commented Jun 8, 2024

@becevka becevka closed this as completed Jun 8, 2024
@becevka becevka reopened this Jun 8, 2024
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

3 participants