Skip to content

feat: new hooks 'findOrCreate'#37

Merged
fratzinger merged 1 commit into
mainfrom
feat/new-hook-findOrCreate
Jun 23, 2026
Merged

feat: new hooks 'findOrCreate'#37
fratzinger merged 1 commit into
mainfrom
feat/new-hook-findOrCreate

Conversation

@fratzinger

Copy link
Copy Markdown
Member

This pull request introduces a new findOrCreate hook to the codebase, providing a reusable way to ensure uniqueness when creating records in FeathersJS services. The hook is thoroughly tested, documented, and exported for use throughout the project.

Key changes:

New Feature: findOrCreate Hook

  • Added the findOrCreate hook implementation, which checks for existing records matching specified fields before creating a new one. It supports configurable behavior for multiple matches and allows for additional query parameters.
  • Created comprehensive tests for the findOrCreate hook, covering type safety, various matching scenarios, and integration as both a before and around hook.
  • Added documentation for the findOrCreate hook, including usage, options, and examples in a new markdown file.

Integration and Exports

  • Exported the new findOrCreate hook from the main hooks index, making it available for import elsewhere in the project.
  • Registered findOrCreate in the hooks test suite to ensure it is included in the project's hook coverage.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying feathers-utils with  Cloudflare Pages  Cloudflare Pages

Latest commit: dddd525
Status: ✅  Deploy successful!
Preview URL: https://d662c865.feathers-utils.pages.dev
Branch Preview URL: https://feat-new-hook-findorcreate.feathers-utils.pages.dev

View logs

@fratzinger fratzinger merged commit b4285ab into main Jun 23, 2026
9 checks passed
@fratzinger fratzinger deleted the feat/new-hook-findOrCreate branch June 23, 2026 22:31
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.

1 participant