Skip to content

Commit 734c9e1

Browse files
committed
Merge pull request #110 from teamsnap/stat-group-linking
Bug fix when saving statistic and stat group linking
2 parents 34e0d88 + e34452e commit 734c9e1

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# TeamSnap JavaScript SDK CHANGELOG
22

3+
### Jan 26, 2016 // Version 1.7.6
4+
- Addresses bug where, When saving a `statistic`, its `statisticGroup` may be incorrectly unlinked.
5+
6+
---
7+
38
### Jan 20, 2016 // Version 1.7.5
49
- Reload `eventStatistics` teamwide when changes to `statistics` or `statisticData`.
510

lib/teamsnap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4412,7 +4412,7 @@ modifySDK = function(sdk) {
44124412
});
44134413
wrapMethod(sdk, 'saveStatistic', function(saveStatistic) {
44144414
return function(statistic, callback) {
4415-
if ((typeof statisticGroupId === "undefined" || statisticGroupId === null) && (statistic.statisticGroup != null)) {
4415+
if ((statistic.statisticGroupId == null) && (statistic.statisticGroup != null)) {
44164416
linking.unlinkItems(statistic.statisticGroup, statistic);
44174417
}
44184418
return saveStatistic.call(this, statistic, callback).then(function(result) {
@@ -5749,7 +5749,7 @@ ref = require('./model'), Collection = ref.Collection, Item = ref.Item;
57495749
require('./errors');
57505750

57515751
TeamSnap = (function() {
5752-
TeamSnap.prototype.version = '1.7.5';
5752+
TeamSnap.prototype.version = '1.7.6';
57535753

57545754
TeamSnap.prototype.promises = promises;
57555755

lib/teamsnap.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "teamsnap.js",
3-
"version": "1.7.5",
3+
"version": "1.7.6",
44
"description": "A JavaScript library for using the TeamSnap API.",
55
"author": "Jacob Wright with TeamSnap (http://www.teamsnap.com)",
66
"homepage": "https://github.com/teamsnap/teamsnap-javascript-sdk",

src/persistence.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ modifySDK = (sdk) ->
421421
wrapMethod sdk, 'saveStatistic', (saveStatistic) ->
422422
(statistic, callback) ->
423423
# Unlink statisticGroup when being removed.
424-
if not statisticGroupId? and statistic.statisticGroup?
424+
if not statistic.statisticGroupId? and statistic.statisticGroup?
425425
linking.unlinkItems statistic.statisticGroup, statistic
426426

427427
saveStatistic.call(this, statistic, callback).then((result) ->

src/teamsnap.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ promises = require './promises'
33
require './errors'
44

55
class TeamSnap
6-
version: '1.7.5'
6+
version: '1.7.6'
77
promises: promises
88
when: promises.when
99
TeamSnap: TeamSnap

0 commit comments

Comments
 (0)