Skip to content

Prevent Self-Reactions Option #8

@Silent-Watcher

Description

@Silent-Watcher

Feature: Add Option to Prevent Self-Reactions

Description:
Add a new plugin option preventSelfReactions: boolean. When enabled, it throws an error if a user tries to react to a document they own (comparing userId with a document's authorId or similar). This requires a new option to specify the path to the author's ID field on the schema.

Acceptance Criteria:

  • New plugin option: preventSelfReactions: boolean.
  • New plugin option: authorIdPath: string (e.g., 'author').
  • The react method checks if userId equals the document's authorIdPath value.
  • If they match and preventSelfReactions is true, an error is thrown.
  • Tests are added for this new validation.
  • Add usage examples in docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions