@naturalcycles/abba 1.15.0 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abba.js +2 -2
- package/dist/dao/experiment.dao.js +0 -1
- package/package.json +1 -1
- package/src/abba.ts +2 -2
- package/src/dao/experiment.dao.ts +1 -2
package/dist/abba.js
CHANGED
|
@@ -62,7 +62,7 @@ class Abba {
|
|
|
62
62
|
if (experiment.status === types_1.AssignmentStatus.Active) {
|
|
63
63
|
(0, util_1.validateTotalBucketRatio)(buckets);
|
|
64
64
|
}
|
|
65
|
-
const updatedExperiment = await this.experimentDao.save(experiment);
|
|
65
|
+
const updatedExperiment = await this.experimentDao.save(experiment, { saveMethod: 'update' });
|
|
66
66
|
const updatedBuckets = await this.bucketDao.saveBatch(buckets.map(b => ({ ...b, experimentId: experiment.id })));
|
|
67
67
|
await this.updateExclusions(updatedExperiment.id, updatedExperiment.exclusions);
|
|
68
68
|
return {
|
|
@@ -90,7 +90,7 @@ class Abba {
|
|
|
90
90
|
requiresUpdating.push(experiment);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
await this.experimentDao.saveBatch(requiresUpdating);
|
|
93
|
+
await this.experimentDao.saveBatch(requiresUpdating, { saveMethod: 'update' });
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Delete an experiment. Removes all user assignments and buckets.
|
package/package.json
CHANGED
package/src/abba.ts
CHANGED
|
@@ -92,7 +92,7 @@ export class Abba {
|
|
|
92
92
|
validateTotalBucketRatio(buckets)
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
const updatedExperiment = await this.experimentDao.save(experiment)
|
|
95
|
+
const updatedExperiment = await this.experimentDao.save(experiment, { saveMethod: 'update' })
|
|
96
96
|
const updatedBuckets = await this.bucketDao.saveBatch(
|
|
97
97
|
buckets.map(b => ({ ...b, experimentId: experiment.id })),
|
|
98
98
|
)
|
|
@@ -132,7 +132,7 @@ export class Abba {
|
|
|
132
132
|
}
|
|
133
133
|
})
|
|
134
134
|
|
|
135
|
-
await this.experimentDao.saveBatch(requiresUpdating)
|
|
135
|
+
await this.experimentDao.saveBatch(requiresUpdating, { saveMethod: 'update' })
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
/**
|
|
@@ -13,9 +13,8 @@ export const experimentDao = (db: CommonDB): ExperimentDao =>
|
|
|
13
13
|
new ExperimentDao({
|
|
14
14
|
db,
|
|
15
15
|
table: 'Experiment',
|
|
16
|
-
createId: false, //
|
|
16
|
+
createId: false, // Always provided on create
|
|
17
17
|
idType: 'number',
|
|
18
|
-
assignGeneratedIds: true,
|
|
19
18
|
hooks: {
|
|
20
19
|
beforeBMToDBM: bm => ({
|
|
21
20
|
...bm,
|