Skip to content

Commit

Permalink
feat(upload file): create schema body for upload file api to it can w…
Browse files Browse the repository at this point in the history
…ork in swagger

Define a custom schema body for the file upload API in Swagger, bypassing the use of Data Transfer
Objects (DTOs) for this specific implementation.
  • Loading branch information
quannhg committed Nov 18, 2023
1 parent 46e5410 commit 1a33700
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ jobs:
docker compose stop ${{vars.DOCKER_COMPOSE_DEPLOY_SERVICE_NAME}}
docker compose down --volumes --remove-orphans
docker compose rm -f ${{vars.DOCKER_COMPOSE_DEPLOY_SERVICE_NAME}}
docker compose up -d ${{vars.DOCKER_COMPOSE_DEPLOY_SERVICE_NAME}}
docker compose up -d ${{vars.DOCKER_COMPOSE_DEPLOY_SERVICE_NAME}} &&
docker exec -it $(docker ps --filter "ancestor=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" -q) /bin/sh -c "npx prisma db seed"
docker exec -it ssps-be /bin/sh -c "npx prisma db seed"
docker logout ${{ env.REGISTRY }}
5 changes: 2 additions & 3 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ jobs:
curl -s https://${{secrets.READ_FILE_ACCESS_TOKEN}}@raw.githubusercontent.com/${{github.repository}}/${{github.head_ref}}/docker-compose.test-deploy.yml -O -f
docker compose -f docker-compose.test-deploy.yml down --volumes --remove-orphans
docker compose -f docker-compose.test-deploy.yml up -d ${{vars.DOCKER_COMPOSE_DEPLOY_SERVICE_NAME}}
docker exec -it $(docker ps --filter "ancestor=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" -q) /bin/sh -c "npx prisma db seed"
docker compose -f docker-compose.test-deploy.yml up -d ${{vars.DOCKER_COMPOSE_DEPLOY_SERVICE_NAME}} &&
docker exec -it ssps-be-test-deploy /bin/sh -c "npx prisma db seed"
docker logout ${{ env.REGISTRY }}
8 changes: 8 additions & 0 deletions src/routes/apis/printingRequest.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ export const printingRequestPlugin = createRoutes('Printing Request', [
roles: ['*'],
schema: {
summary: 'Upload file to printing request',
consumes: ['multipart/form-data'],
params: UploadFileParamsDto,
body: {
type: 'object',
required: ['file'],
properties: {
file: { isFile: true }
}
},
response: {
200: UploadFileResultDto
}
Expand Down

0 comments on commit 1a33700

Please sign in to comment.