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

feat(polls): allow editing of draft polls #13883

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

miaulalala
Copy link
Contributor

@miaulalala miaulalala commented Nov 27, 2024

☑️ Resolves

🛠️ API Checklist

🚧 Tasks

  • Add capability

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • 📘 API documentation in docs/ has been updated or is not required
  • 🔖 Capability is added or not needed

@miaulalala
Copy link
Contributor Author

@nickvergessen wdyt of adding the validation to the setters in the Poll Entity instead of validating them beforehand? Would make sense, don't you think?

@nickvergessen nickvergessen added 2. developing feature: api 🛠️ OCS API for conversations, chats and participants feature: polls 📊 labels Nov 28, 2024
@nickvergessen nickvergessen added this to the 🖤 Next Major (31) milestone Nov 28, 2024
@miaulalala miaulalala force-pushed the feat/edit-delete-poll-drafts branch from 8e473b0 to 9dcf018 Compare December 2, 2024 12:00
@miaulalala miaulalala marked this pull request as ready for review December 5, 2024 14:19
docs/poll.md Outdated Show resolved Hide resolved
docs/capabilities.md Show resolved Hide resolved
docs/poll.md Outdated Show resolved Hide resolved
lib/Controller/PollController.php Outdated Show resolved Hide resolved
lib/Controller/PollController.php Outdated Show resolved Hide resolved
lib/Controller/PollController.php Outdated Show resolved Hide resolved
lib/Controller/PollController.php Outdated Show resolved Hide resolved
Signed-off-by: Anna Larch <anna@nextcloud.com>

# The commit message #2 will be skipped:

# fixup! feat(polls): allow editing of draft polls
@miaulalala miaulalala force-pushed the feat/edit-delete-poll-drafts branch from 2aeb3ef to 0ca00dd Compare December 9, 2024 11:41
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

Mostly minor things and reaching the end soon :)

lib/Controller/PollController.php Outdated Show resolved Hide resolved
try {
$poll = $this->pollService->getPoll($this->room->getId(), $pollId);
} catch (DoesNotExistException $e) {
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_NOT_FOUND);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_NOT_FOUND);
return new DataResponse(['error' => PollPropertyException::REASON_POLL], Http::STATUS_NOT_FOUND);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This gives me a MoreSpecificReturnType error, same with the change below

lib/Controller/PollController.php Outdated Show resolved Hide resolved
lib/Controller/PollController.php Outdated Show resolved Hide resolved
lib/Controller/PollController.php Outdated Show resolved Hide resolved
lib/Service/PollService.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review feature: api 🛠️ OCS API for conversations, chats and participants feature: polls 📊
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polls - Add option to edit a draft or delete a previous draft when editing (on API level)
2 participants