Skip to content

Commit 2b5e4fa

Browse files
committed
fix: Fixed bugs with refresh and import
1 parent c186cd0 commit 2b5e4fa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/connect/http-routes/handlers/import-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function importHandler() {
2929
throw new Error('Unable to parse import type');
3030
}
3131

32-
if (type === ImportType.IMPORT_SPECIFIC && (!resourceTypes || Array.isArray(resourceTypes))) {
32+
if (type === ImportType.IMPORT_SPECIFIC && (!resourceTypes || !Array.isArray(resourceTypes))) {
3333
throw new Error('For import specific, a list of resource types must be provided');
3434
}
3535

src/connect/http-routes/handlers/refresh-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function refreshHandler() {
2929
throw new Error('Unable to parse import type');
3030
}
3131

32-
if (type === RefreshType.REFRESH_SPECIFIC && (!resourceTypes || Array.isArray(resourceTypes))) {
32+
if (type === RefreshType.REFRESH_SPECIFIC && (!resourceTypes || !Array.isArray(resourceTypes))) {
3333
throw new Error('For refresh specific, a list of resource types must be provided');
3434
}
3535

src/orchestrators/refresh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class RefreshOrchestrator {
3030
await pluginManager.validate(project);
3131
const importResult = await ImportOrchestrator.import(
3232
pluginManager,
33-
project.resourceConfigs.filter((r) => !typeIds || typeIds.includes(r.type))
33+
project.resourceConfigs.filter((r) => !typeIds || typeIds.length === 0 || typeIds.includes(r.type))
3434
);
3535

3636
ctx.processFinished(ProcessName.REFRESH);

0 commit comments

Comments
 (0)