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

fix(@aws-amplify/datastore): Make save return a single model instead … #5199

Merged
merged 1 commit into from
Mar 26, 2020

Conversation

manueliglesias
Copy link
Contributor

…of array

Issue #, if available:
Fixes #5099

Description of changes:
DataStore.save was incorrectly returning the very same array that storage.save was returning. It should only return the first element of that array, which corresponds to the model being saved.

Note: The array is internally used to notify observers of newly created connected models

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link

codecov bot commented Mar 26, 2020

Codecov Report

Merging #5199 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5199   +/-   ##
=======================================
  Coverage   73.21%   73.21%           
=======================================
  Files         193      193           
  Lines       11441    11441           
  Branches     2218     2218           
=======================================
  Hits         8377     8377           
  Misses       2916     2916           
  Partials      148      148           
Impacted Files Coverage Δ
packages/datastore/src/datastore/datastore.ts 70.80% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05f1b54...e28f2be. Read the comment docs.

Copy link
Contributor

@Ashish-Nanda Ashish-Nanda left a comment

Choose a reason for hiding this comment

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

Good catch. LGTM!

@manueliglesias manueliglesias added the DataStore Related to DataStore category label Mar 26, 2020
@manueliglesias manueliglesias merged commit 1d0b8e1 into aws-amplify:master Mar 26, 2020
@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DataStore Related to DataStore category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to save array of objects in datastore
2 participants