Skip to content

Fix the issue in product question creation - #33

Open
mausamp wants to merge 2 commits into
fix/vendor-questions-fetchfrom
fix/qa-decorator
Open

Fix the issue in product question creation#33
mausamp wants to merge 2 commits into
fix/vendor-questions-fetchfrom
fix/qa-decorator

Conversation

@mausamp

@mausamp mausamp commented Mar 13, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@product_question = Spree::ProductQuestion.new(product_question_params)
@product_question.product = @product
@product_question.user_id = spree_current_user.id
@product_question.user_id = spree_current_user&.id

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we require user to be logged in to create product question right?
why have we implemented this failsafe?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is config for the admins to allow or disallow anonymous questions, this was giving issues in case of anonymous being enabled.

Should we just revert this and force only signed in users to create questions?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we are asking right question when we are asking:
"Should we just revert this and force only signed in users to create questions?"

It is always better idea to have the configuration to be enabled or disabled..
but as you said, this should be only inserted if the config has allowed to have anonymous review.

should we not insert user id only when anonymouse review is not allowed and raise appropriate error?

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

Successfully merging this pull request may close these issues.

2 participants