Skip to content

Commit

Permalink
Merge pull request #2413 from posit-dev/dotnomad/frontend-connect-env
Browse files Browse the repository at this point in the history
Add frontend types for environment API endpoint
  • Loading branch information
dotNomad authored Oct 31, 2024
2 parents b723c69 + 09b3b97 commit 6f7dcce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions extensions/vscode/src/api/resources/ContentRecords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
PreContentRecord,
AllContentRecordTypes,
ContentRecord,
Environment,
} from "../types/contentRecords";

export class ContentRecords {
Expand Down Expand Up @@ -130,4 +131,16 @@ export class ContentRecords {
},
);
}

getEnv(deploymentName: string, dir: string) {
const encodedName = encodeURIComponent(deploymentName);
return this.client.get<Environment>(
`deployments/${encodedName}/environment`,
{
params: {
dir,
},
},
);
}
}
2 changes: 2 additions & 0 deletions extensions/vscode/src/api/types/contentRecords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export type AllContentRecordTypes =
| PreContentRecordWithConfig
| ContentRecordError;

export type Environment = Array<string>;

export function isSuccessful(
d: AllContentRecordTypes | undefined,
): boolean | undefined {
Expand Down

0 comments on commit 6f7dcce

Please sign in to comment.