Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

fix(repository): defer to toJSON for hidden property exclusion #39

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

shubhamp-sf
Copy link
Collaborator

Description

Previously, the package used a custom excludeHiddenProps function to exclude hidden fields. Which prevented users from accessing those fields on backend. With this change, we now defer to the LoopBack Model's built-in toJSON method, which already handles the exclusion of hidden properties when serializing data for a response.

GH-37

Fixes #37

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

Previously, the package used a custom `excludeHiddenProps` function to exclude hidden fields.
Which prevented users from accessing those fields on backend.
With this change, we now defer to the LoopBack Model's built-in toJSON method,
which already handles the exclusion of hidden properties when serializing data for a response.

GH-37
@shubhamp-sf shubhamp-sf merged commit 7e36924 into master Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in Entity "hiddenProperty" behavior when creating a new entity via SequelizeCrudRepository#create
1 participant