From bd9f25d735afd9aac2968e023514a5ef673c642c Mon Sep 17 00:00:00 2001 From: afwilcox Date: Wed, 18 Oct 2023 13:52:58 -0700 Subject: [PATCH] Fix Species Capitilization (and order by) --- backend/db/migrations/R__Code-table-description-updates.sql | 5 +++++ backend/src/v1/species_code/species_code.service.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 backend/db/migrations/R__Code-table-description-updates.sql diff --git a/backend/db/migrations/R__Code-table-description-updates.sql b/backend/db/migrations/R__Code-table-description-updates.sql new file mode 100644 index 000000000..02cccb739 --- /dev/null +++ b/backend/db/migrations/R__Code-table-description-updates.sql @@ -0,0 +1,5 @@ +-- species +UPDATE species_code set short_description = 'Grizzly Bear', long_description = 'Grizzly Bear' WHERE species_code = 'GRZBEAR'; +UPDATE species_code set short_description = 'Hog/Pig/Boar (Feral)', long_description = 'Hog/Pig/Boar (Feral)' WHERE species_code = 'FERALHOG'; +UPDATE species_code set short_description = 'Mountain Goat', long_description = 'Mountain Goat' WHERE species_code = 'MTNGOAT'; +UPDATE species_code set short_description = 'River Otter', long_description = 'River Otter' WHERE species_code = 'RVROTTER'; \ No newline at end of file diff --git a/backend/src/v1/species_code/species_code.service.ts b/backend/src/v1/species_code/species_code.service.ts index 3e0ef3181..1c21bc3fa 100644 --- a/backend/src/v1/species_code/species_code.service.ts +++ b/backend/src/v1/species_code/species_code.service.ts @@ -19,7 +19,9 @@ export class SpeciesCodeService { } async findAll(): Promise { - return this.speciesCodeRepository.find(); + return (await this.speciesCodeRepository.find( + {order: {display_order: "ASC"}} + )); } async findOne(id: string): Promise {