Skip to content

Commit

Permalink
Fixed a bug in the create() method of useVingKind & useVingRecord whe…
Browse files Browse the repository at this point in the history
…re props passed in to the function would be overridden by the defaults.
  • Loading branch information
rizen committed Apr 10, 2024
1 parent d07a510 commit 46bbd90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composables/useVingKind.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class VingKind {
*/
create(props = {}, options = {}) {
const self = this;
const newProps = _.defaultsDeep({}, self.new, props);
const newProps = _.defaultsDeep({}, props, self.new);
const newRecord = self.mint({ props: newProps });
const addIt = function () {
if (options?.unshift || self.#behavior?.unshift) {
Expand Down
2 changes: 1 addition & 1 deletion composables/useVingRecord.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default (behavior) => {
*/

async create(props, options) {
const newProps = _.defaultsDeep({}, this.props, props);
const newProps = _.defaultsDeep({}, props, this.props);
const response = await useRest(this.getCreateApi(), {
query: this.query,
method: 'post',
Expand Down
1 change: 1 addition & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ outline: deep
* Implemented: filterQualifier: true should be in the examples for all relation ids #96
* Implemented: add documentation to ving schema about filterQuery #87
* Added recordsAsOptions() method to the useVingKind() composable.
* Fixed a bug in the create() method of useVingKind & useVingRecord where props passed in to the function would be overridden by the defaults.

## 2024-04-09
* Fixed: no type int example in ving schema #82
Expand Down

0 comments on commit 46bbd90

Please sign in to comment.