Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
push:
branches:
- main
- develop
- staging
pull_request:
branches:
- main
- develop
- staging

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Para un entorno de producción se requiere una base de datos real provisionada (

1. Crea y configura el archivo `.env` con las variables reales de producción.
2. Construye el proyecto e inicia el servidor en modo producción:

```bash
npm run prod
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class AssistanceApplicationsController {

@Get(':id/document')
findOneDocument(@Param('id') id: string) {
return this.assistanceApplicationsService.findOneDocument(id);
return this.assistanceApplicationsService.findOne(id, true);
}

@Patch(':id')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,15 @@ export class AssistanceApplicationsService {
return results;
}

async findOne(id: string) {
async findOne(id: string, withDocument: boolean = false) {
const application = await this.assistanceApplicationRepository.findOne({
where: { id },
relations: {
graduatedAssistance: {
professor: true,
},
student: true,
document: true,
},
});
if (!application) {
throw new NotFoundException(
`Assistance Application with ID ${id} not found`,
);
}
return application;
}

async findOneDocument(id: string) {
const application = await this.assistanceApplicationRepository.findOne({
where: { id },
relations: {
graduatedAssistance: {
professor: true,
},
student: true,
document: true,
document: withDocument,
},
});
if (!application) {
Expand Down
Loading