mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-11-22 16:26:10 +08:00
Refactor rollout configuration handling in bindVersionToPackages; replace rollout logic with direct package binding and update API call to use POST method.
This commit is contained in:
@@ -122,17 +122,6 @@ export const bindVersionToPackages = async ({
|
||||
console.log(chalk.yellow(t('dryRun')));
|
||||
}
|
||||
if (rollout !== undefined) {
|
||||
const rolloutConfig: Record<string, number> = {};
|
||||
for (const pkg of pkgs) {
|
||||
rolloutConfig[pkg.name] = rollout;
|
||||
}
|
||||
if (!dryRun) {
|
||||
await put(`/app/${appId}/version/${versionId}`, {
|
||||
config: {
|
||||
rollout: rolloutConfig,
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log(
|
||||
`${t('rolloutConfigSet', {
|
||||
versions: pkgs.map((pkg: Package) => pkg.name).join(', '),
|
||||
@@ -142,8 +131,10 @@ export const bindVersionToPackages = async ({
|
||||
}
|
||||
for (const pkg of pkgs) {
|
||||
if (!dryRun) {
|
||||
await put(`/app/${appId}/package/${pkg.id}`, {
|
||||
await post(`/app/${appId}/binding`, {
|
||||
versionId,
|
||||
rollout,
|
||||
packageId: pkg.id,
|
||||
});
|
||||
}
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user