Skip to content

Commit

Permalink
create Photo instance from taxon representative_photo if present
Browse files Browse the repository at this point in the history
  • Loading branch information
pleary committed Dec 31, 2024
1 parent 5095203 commit 9922b31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build/inaturalistjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2448,6 +2448,9 @@ var Taxon = /*#__PURE__*/function (_Model) {
if (_this.default_photo && _this.default_photo !== undefined) {
_this.defaultPhoto = new Photo(_this.default_photo);
}
if (_this.representative_photo && _this.representative_photo !== undefined) {
_this.representativePhoto = new Photo(_this.representative_photo);
}
if (_this.taxon_photos && _this.taxon_photos !== undefined) {
_this.taxonPhotos = _this.taxon_photos.map(function (tp) {
return {
Expand Down
3 changes: 3 additions & 0 deletions lib/models/taxon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const Taxon = class Taxon extends Model {
if ( this.default_photo && this.default_photo !== undefined ) {
this.defaultPhoto = new Photo( this.default_photo );
}
if ( this.representative_photo && this.representative_photo !== undefined ) {
this.representativePhoto = new Photo( this.representative_photo );
}
if ( this.taxon_photos && this.taxon_photos !== undefined ) {
this.taxonPhotos = this.taxon_photos.map( tp => ( {
taxon: new Taxon( tp.taxon ),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inaturalistjs",
"version": "2.15.0",
"version": "2.16.0",
"description": "inaturalistjs",
"author": "iNaturalist",
"license": "MIT",
Expand Down

0 comments on commit 9922b31

Please sign in to comment.