Skip to content

Commit

Permalink
fix: gettingStarted samples route
Browse files Browse the repository at this point in the history
Signed-off-by: olexii4 <oorel@redhat.com>
  • Loading branch information
olexii4 committed Sep 12, 2023
1 parent f0ef08e commit f450f49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/dashboard-backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ export default async function buildApp(server: FastifyInstance): Promise<void> {

registerPersonalAccessTokenRoutes(server);

registerGettingStartedSamplesRoutes(server);
registerGettingStartedSamplesRoutes(isLocalRun(), server);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ import { getServiceAccountToken } from './helpers/getServiceAccountToken';

const tags = ['Getting Started Samples'];

export function registerGettingStartedSamplesRoutes(instance: FastifyInstance) {
export function registerGettingStartedSamplesRoutes(
isLocalRun: boolean,
instance: FastifyInstance,
) {
instance.register(async server => {
server.get(`${baseApiPath}/getting-started-sample`, getSchema({ tags }), async () => {
if (isLocalRun) {
return [];
}
const token = getServiceAccountToken();
const { gettingStartedSampleApi } = getDevWorkspaceClient(token);
return gettingStartedSampleApi.list();
Expand Down

0 comments on commit f450f49

Please sign in to comment.