Skip to content

Commit e8a9cc8

Browse files
authored
properly pass region to job selection prompt (#127)
* properly pass region to job selection prompt * bump patch version
1 parent edcbaff commit e8a9cc8

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mondaycom/apps-cli",
3-
"version": "4.7.0",
3+
"version": "4.7.1",
44
"description": "A cli tool to manage apps (and monday-code projects) in monday.com",
55
"author": "monday.com Apps Team",
66
"type": "module",

src/commands/scheduler/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class SchedulerDelete extends AuthenticatedCommand {
2222
try {
2323
if (!appId) appId = await DynamicChoicesService.chooseApp();
2424
const selectedRegion = await chooseRegionIfNeeded(parsedRegion, { appId });
25-
if (!name) name = await DynamicChoicesService.chooseSchedulerJob(appId);
25+
if (!name) name = await DynamicChoicesService.chooseSchedulerJob(appId, selectedRegion);
2626

2727
logger.debug(`Deleting scheduler job ${name} for appId: ${appId}`, this.DEBUG_TAG);
2828
this.preparePrintCommand(this, {

src/commands/scheduler/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class SchedulerRun extends AuthenticatedCommand {
2222
try {
2323
if (!appId) appId = await DynamicChoicesService.chooseApp();
2424
const selectedRegion = await chooseRegionIfNeeded(parsedRegion, { appId });
25-
if (!name) name = await DynamicChoicesService.chooseSchedulerJob(appId);
25+
if (!name) name = await DynamicChoicesService.chooseSchedulerJob(appId, selectedRegion);
2626

2727
logger.debug(`Running scheduler job ${name} for appId: ${appId}`, this.DEBUG_TAG);
2828
this.preparePrintCommand(this, {

src/commands/scheduler/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class SchedulerUpdate extends AuthenticatedCommand {
3030
try {
3131
if (!appId) appId = await DynamicChoicesService.chooseApp();
3232
const selectedRegion = await chooseRegionIfNeeded(parsedRegion, { appId });
33-
if (!name) name = await DynamicChoicesService.chooseSchedulerJob(appId);
33+
if (!name) name = await DynamicChoicesService.chooseSchedulerJob(appId, selectedRegion);
3434

3535
// Get the current job details
3636
const jobs = await SchedulerService.listJobs(appId, selectedRegion);

src/services/dynamic-choices-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { listApps } from 'services/apps-service';
77
import { PromptService } from 'services/prompt-service';
88
import { LIVE_VERSION_ERROR_LOG } from 'src/consts/messages';
99
import { AppId } from 'src/types/general';
10+
import { Region } from 'src/types/general/region';
1011
import { AppFeature, AppFeatureType } from 'src/types/services/app-features-service';
1112

1213
import { SchedulerService } from './scheduler-service';
@@ -137,8 +138,8 @@ export const DynamicChoicesService = {
137138
return APP_TEMPLATES_CONFIG.find(template => template.name === selectedTemplateName)!;
138139
},
139140

140-
async chooseSchedulerJob(appId: AppId) {
141-
const jobs = await SchedulerService.listJobs(appId);
141+
async chooseSchedulerJob(appId: AppId, region?: Region) {
142+
const jobs = await SchedulerService.listJobs(appId, region);
142143
const jobChoicesMap: Record<string, string> = {};
143144
for (const job of jobs) {
144145
jobChoicesMap[`${job.name} (${job.targetUrl})`] = job.name;

0 commit comments

Comments
 (0)