Skip to content

Commit 051eee0

Browse files
committed
Display an information item if examples can't be loaded
Signed-off-by: Seb Julliand <[email protected]>
1 parent 7576d5c commit 051eee0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/database/serviceInfo.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { SQLExample } from "../views/examples";
21
import { JobManager } from "../config";
2+
import { SQLExample } from "../views/examples";
33
import Statement from "./statement";
44

5-
export async function getServiceInfo(): Promise<SQLExample[]|undefined> {
5+
export async function getServiceInfo(): Promise<SQLExample[]> {
66
// The reason we check for a selection is because we don't want it to prompt the user to start one here
77
if (JobManager.getSelection()) {
8-
const resultSet = await JobManager.runSQL<{SERVICE_NAME: string, EXAMPLE: string}>(`select SERVICE_NAME, EXAMPLE from qsys2.services_info`);
8+
const resultSet = await JobManager.runSQL<{ SERVICE_NAME: string, EXAMPLE: string }>(`select SERVICE_NAME, EXAMPLE from qsys2.services_info`);
99

1010
return resultSet.map(r => ({
1111
name: Statement.prettyName(r.SERVICE_NAME),
1212
content: [r.EXAMPLE],
1313
}))
1414
} else {
15-
return undefined;
15+
return [{ name: "Please start an SQL job to load the examples", content: [""] }];
1616
}
1717
}

0 commit comments

Comments
 (0)