Closed waihon closed 3 years ago
{ rating }
is a shorthand for { rating: rating }
so both work but you see the short-hand form quite often these days as it's quite elegant (and you don't have to type that much :) ).
You can't use a shorthand for { title: this.title }
as this is not the same as { title: title }
.
On page 125, the saveSong() has a payload with attributes having a key-value pair, i.e.
attributes: { title: this.title }
.On page 127, the updateRating() has a payload with just
attributes: { rating }
.May I know why
{ rating }
would work and not{ rating: rating }
?