Skip to content

Commit

Permalink
fix: resolved ApiParam inconsistencies and corrected TypeScript-Angul…
Browse files Browse the repository at this point in the history
…ar generator name in openapi-generator
  • Loading branch information
Junjiequan committed Sep 19, 2024
1 parent 24d58a1 commit c811b4a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions .github/workflows/release-and-publish-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
- start-backend-export-swagger
strategy:
matrix:
generator: [python, python-pydantic-v1, typescript]
generator: [python, python-pydantic-v1, typescript-angular]

steps:
- name: Checkout repository
Expand All @@ -152,7 +152,7 @@ jobs:
--git-repo-id scicat-backend-next \
--git-user-id SciCatProject \
-o ./sdk/${{ matrix.generator }} $(
if [ "${{ matrix.generator }}" == "typescript" ]; then
if [ "${{ matrix.generator }}" == "typescript-angular" ]; then
echo "--additional-properties=npmVersion=${{ needs.build-release.outputs.new_tag}}";
elif [ "${{ matrix.generator }}" == "python" ]; then
echo "--additional-properties=packageVersion=${{ needs.build-release.outputs.new_tag}}";
Expand Down Expand Up @@ -183,18 +183,18 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org/"

- name: Download TypeScript SDK Artifact
- name: Download TypeScript Angular SDK Artifact
uses: actions/download-artifact@v4
with:
name: sdk-typescript-${{github.sha}}
name: sdk-typescript-angular-${{github.sha}}
path: ./sdk

- name: Publish package
run: |
npm install
npm run build
npm publish --access public
working-directory: ./sdk/typescript/
working-directory: ./sdk/typescript-angular/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-sdk-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- start-backend-and-upload-swagger-schema
strategy:
matrix:
generator: [python, typescript, python-pydantic-v1]
generator: [python, typescript-angular, python-pydantic-v1]

steps:
- name: Checkout repository
Expand All @@ -67,7 +67,7 @@ jobs:
config-file: .github/openapi/${{ matrix.generator }}-config.json
command-args: |
-o ./sdk/${{ matrix.generator }} $(
if [ "${{ matrix.generator }}" == "typescript" ]; then
if [ "${{ matrix.generator }}" == "typescript-angular" ]; then
echo "--additional-properties=npmVersion=${{env.SDK_VERSION}}";
elif [ "${{ matrix.generator }}" == "python" ]; then
echo "--additional-properties=packageVersion=${{env.SDK_VERSION}}";
Expand Down
18 changes: 9 additions & 9 deletions src/samples/samples.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export class SamplesController {
"Returns a boolean indicating whether the user has access to the sample with the specified ID.",
})
@ApiParam({
name: "pid",
name: "id",
description: "ID of the sample to check access for",
type: String,
})
Expand Down Expand Up @@ -774,17 +774,17 @@ export class SamplesController {
})
async findOneAttachment(
@Req() request: Request,
@Param("id") sampleId: string,
@Param("id") id: string,
@Param("fk") attachmentId: string,
): Promise<Attachment | null> {
await this.checkPermissionsForSample(
request,
sampleId,
id,
Action.SampleAttachmentRead,
);
return this.attachmentsService.findOne({
id: attachmentId,
sampleId: sampleId,
sampleId: id,
});
}

Expand Down Expand Up @@ -816,17 +816,17 @@ export class SamplesController {
})
async findOneAttachmentAndRemove(
@Req() request: Request,
@Param("id") sampleId: string,
@Param("id") id: string,
@Param("fk") attachmentId: string,
): Promise<unknown> {
await this.checkPermissionsForSample(
request,
sampleId,
id,
Action.SampleAttachmentDelete,
);
return this.attachmentsService.findOneAndDelete({
_id: attachmentId,
sampleId: sampleId,
sampleId: id,
});
}

Expand Down Expand Up @@ -867,7 +867,7 @@ export class SamplesController {
})
async findAllDatasets(
@Req() request: Request,
@Param("id") sampleId: string,
@Param("id") id: string,
): Promise<DatasetClass[] | null> {
const user: JWTUser = request.user as JWTUser;
const ability = this.caslAbilityFactory.samplesInstanceAccess(user);
Expand Down Expand Up @@ -900,7 +900,7 @@ export class SamplesController {
}

const dataset = await this.datasetsService.fullquery({
where: { sampleId },
where: { sampleId: id },
fields: fields,
});
return dataset;
Expand Down

0 comments on commit c811b4a

Please sign in to comment.