-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Feat/questions optional #687
base: main
Are you sure you want to change the base?
Feat/questions optional #687
Conversation
…tribute in User model
@MrPunyapal do you think I need to do anything else? If so please let me know. |
Tests are missing And also a validation in a questions/create component |
I would call it |
…ut for prefers_questions
…at profile or prefer questions
…y.com into feat/questions-optional
…clean up code formatting
…uestion reception
…tests accordingly
Things I changed
|
resources/views/profile/partials/update-profile-information-form.blade.php
Show resolved
Hide resolved
name="prefers_questions" | ||
class="mt-1 block w-full" | ||
class="mt-1 block w-full" | ||
:options="[true => __('People can ask me questions'), false => __('I do not want to receive questions')]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep it simple "yes" and "no"
@@ -206,6 +205,13 @@ public function store(Request $request): void | |||
|
|||
$user = type($request->user())->as(User::class); | |||
|
|||
$toUser = User::findOrFail($this->toId); | |||
|
|||
if (!$toUser->prefers_questions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please run Pint
$toUser = User::findOrFail($this->toId); | ||
|
||
if (!$toUser->prefers_questions) { | ||
$this->addError('content', __('This user does not accept questions.')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better we refresh the page with a notification so it resets the page and removes the component from the page.
issue #630.
"Currently, the questions feature is not optional, but some people, like me, may not want to use it, since Pinkary's initial proposal - I think, was for bio links."