Skip to content

Commit 818907f

Browse files
committed
Refactor rollout configuration handling in bindVersionToPackages; replace rollout logic with direct package binding and update API call to use POST method.
1 parent 6751daf commit 818907f

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update-cli",
3-
"version": "2.3.2",
3+
"version": "2.4.0",
44
"description": "command line tool for react-native-update (remote updates for react native)",
55
"main": "index.js",
66
"bin": {

src/versions.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,6 @@ export const bindVersionToPackages = async ({
122122
console.log(chalk.yellow(t('dryRun')));
123123
}
124124
if (rollout !== undefined) {
125-
const rolloutConfig: Record<string, number> = {};
126-
for (const pkg of pkgs) {
127-
rolloutConfig[pkg.name] = rollout;
128-
}
129-
if (!dryRun) {
130-
await put(`/app/${appId}/version/${versionId}`, {
131-
config: {
132-
rollout: rolloutConfig,
133-
},
134-
});
135-
}
136125
console.log(
137126
`${t('rolloutConfigSet', {
138127
versions: pkgs.map((pkg: Package) => pkg.name).join(', '),
@@ -142,8 +131,10 @@ export const bindVersionToPackages = async ({
142131
}
143132
for (const pkg of pkgs) {
144133
if (!dryRun) {
145-
await put(`/app/${appId}/package/${pkg.id}`, {
134+
await post(`/app/${appId}/binding`, {
146135
versionId,
136+
rollout,
137+
packageId: pkg.id,
147138
});
148139
}
149140
console.log(

0 commit comments

Comments
 (0)