Skip to content

Commit 5a0b546

Browse files
authored
Solve reliability and security codesmells
* staging * enhance/solve-reliability-and-security-codesmells * enhance/change-datatable-for-assistantship-application-list
1 parent 7e29cef commit 5a0b546

File tree

45 files changed

+307
-466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+307
-466
lines changed

.github/workflows/run_test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ on:
44
push:
55
branches:
66
- main
7+
- develop
8+
- staging
79
pull_request:
810
branches:
911
- main
12+
- develop
13+
- staging
1014

1115
jobs:
1216
test:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Para un entorno de producción se requiere una base de datos real provisionada (
157157

158158
1. Crea y configura el archivo `.env` con las variables reales de producción.
159159
2. Construye el proyecto e inicia el servidor en modo producción:
160+
160161
```bash
161162
npm run prod
162163
```

apps/api/src/assistance-applications/assistance-applications.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class AssistanceApplicationsController {
7171

7272
@Get(':id/document')
7373
findOneDocument(@Param('id') id: string) {
74-
return this.assistanceApplicationsService.findOneDocument(id);
74+
return this.assistanceApplicationsService.findOne(id, true);
7575
}
7676

7777
@Patch(':id')

apps/api/src/assistance-applications/assistance-applications.service.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,34 +69,15 @@ export class AssistanceApplicationsService {
6969
return results;
7070
}
7171

72-
async findOne(id: string) {
72+
async findOne(id: string, withDocument: boolean = false) {
7373
const application = await this.assistanceApplicationRepository.findOne({
7474
where: { id },
7575
relations: {
7676
graduatedAssistance: {
7777
professor: true,
7878
},
7979
student: true,
80-
document: true,
81-
},
82-
});
83-
if (!application) {
84-
throw new NotFoundException(
85-
`Assistance Application with ID ${id} not found`,
86-
);
87-
}
88-
return application;
89-
}
90-
91-
async findOneDocument(id: string) {
92-
const application = await this.assistanceApplicationRepository.findOne({
93-
where: { id },
94-
relations: {
95-
graduatedAssistance: {
96-
professor: true,
97-
},
98-
student: true,
99-
document: true,
80+
document: withDocument,
10081
},
10182
});
10283
if (!application) {

0 commit comments

Comments
 (0)