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

update(api): centralize updateOne error handling logic #579

Merged

Conversation

yassinedorbozgithub
Copy link
Collaborator

@yassinedorbozgithub yassinedorbozgithub commented Jan 16, 2025

Motivation

The main motivation of this PR is to update the code related to the updateOne methods (repository, service).

Fixes #576

Checklist:

  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes

@yassinedorbozgithub yassinedorbozgithub added the enhancement New feature or request label Jan 16, 2025
@yassinedorbozgithub yassinedorbozgithub self-assigned this Jan 16, 2025
@yassinedorbozgithub yassinedorbozgithub linked an issue Jan 16, 2025 that may be closed by this pull request
@yassinedorbozgithub yassinedorbozgithub changed the title refactor(api): Refactor updateOne logic refactor(api): centralize updateOne logic Jan 16, 2025
@yassinedorbozgithub yassinedorbozgithub marked this pull request as draft January 16, 2025 17:54
@yassinedorbozgithub yassinedorbozgithub marked this pull request as ready for review January 17, 2025 06:17
@yassinedorbozgithub yassinedorbozgithub changed the title refactor(api): centralize updateOne logic refactor(api): centralize updateOne error handling logic Jan 17, 2025
api/src/utils/generics/base-repository.ts Outdated Show resolved Hide resolved
api/src/utils/generics/base-repository.ts Show resolved Hide resolved
api/src/chat/repositories/block.repository.spec.ts Outdated Show resolved Hide resolved
api/src/chat/repositories/block.repository.spec.ts Outdated Show resolved Hide resolved
@yassinedorbozgithub yassinedorbozgithub changed the title refactor(api): centralize updateOne error handling logic update(api): centralize updateOne error handling logic Jan 17, 2025
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/

export const getUpdateOneError = (entity: string, id?: string) =>
Copy link
Member

Choose a reason for hiding this comment

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

is id optional for the sake of tests?

@marrouchi marrouchi merged commit 854cfd8 into main Jan 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🤔 [ISSUE] - Update updateOne logic to centralize logs
3 participants