Skip to content

Commit

Permalink
Merge pull request #7 from CinCoders/feature/res-10
Browse files Browse the repository at this point in the history
Fix: fix upsert of journal and conference publications
  • Loading branch information
dcruzb authored Oct 31, 2023
2 parents 1601da3 + a508bae commit b7d502f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/import-xml/import-xml.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ export class ImportXmlService {
}
}
} finally {
queryRunner.release();
await queryRunner.release();
}
}
}
2 changes: 1 addition & 1 deletion src/post-graduation/post-graduation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class PostGraduationService {

await queryRunner.connect();

const result = queryRunner.query(`
const result = await queryRunner.query(`
SELECT
${groupByProfessor ? 'p.id as "professorId",' : ''}
${groupByProfessor ? 'p.name as "professorName",' : ''}
Expand Down
2 changes: 1 addition & 1 deletion src/professor/professor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class ProfessorService {

const queryRunner = AppDataSource.createQueryRunner();

const result = queryRunner.query(
const result = await queryRunner.query(
`
${
journalPublications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ export class JournalPublicationService {
if (journal.issn === journalPublication.issn) {
journalPublication.journal = journal;
journalPublication.qualis = journal.qualis;

if (journal.isTop) {
journalPublication.isTop = true;
}

await AppDataSource.createQueryBuilder(queryRunner)
.insert()
.into(JournalPublication)
.values(journalPublication)
.orUpdate(['qualis', 'journal_id'], ['id'])
.orUpdate(['qualis', 'journal_id', 'is_top'], ['id'])
.execute();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/professor/services/conference/conference.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class ConferencePublicationService {
.into(ConferencePublication)
.values(conferencePublication)
.orUpdate(
['title', 'proceedings', 'qualis', 'conference_id'],
['title', 'proceedings', 'qualis', 'conference_id', 'is_top'],
['id'],
)
.execute();
Expand Down

0 comments on commit b7d502f

Please sign in to comment.