Hub 2.24.1: Servers -> Updates offers every product
The product tabs were a fixed Events/Accounts list from before the Church Website, so Website installs couldn't be batch-updated there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1200,7 +1200,7 @@ async function scheduleUpdate({ deploymentIds, product: wanted = null, version,
|
||||
const deployments = await prisma.deployment.findMany({ where: { id: { in: ids } }, include: { server: true, install: true, customer: true } });
|
||||
if (deployments.length !== ids.length) throw fail(404, 'NOT_FOUND', 'One of the installs wasn\'t found.');
|
||||
const products = new Set(deployments.map(d => d.product));
|
||||
if (products.size !== 1) throw fail(400, 'BAD_REQUEST', 'A batch is for one product: choose Cross Events or Accounts installs, not both.');
|
||||
if (products.size !== 1) throw fail(400, 'BAD_REQUEST', 'A batch is for one product: choose installs of one product, not several (or update a whole church from its customer page).');
|
||||
const product = [...products][0];
|
||||
// Hub 2.6.0: the page says which product it's updating; a mismatch is refused, never guessed.
|
||||
if (wanted && wanted !== product) throw fail(400, 'WRONG_PRODUCT', `These installs are ${PRODUCT_NAMES[product]}, not ${PRODUCT_NAMES[wanted] || wanted}.`);
|
||||
|
||||
Reference in New Issue
Block a user