-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
213 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const iNaturalistAPI = require( "../inaturalist_api" ); | ||
const SavedLocation = require( "../models/saved_location" ); | ||
|
||
const savedLocations = class savedLocations { | ||
static search( params, opts = { } ) { | ||
return iNaturalistAPI.get( "saved_locations", params, { ...opts, useAuth: true } ) | ||
.then( SavedLocation.typifyResultsResponse ); | ||
} | ||
|
||
static create( params, options ) { | ||
return iNaturalistAPI.post( "saved_locations", params, options ) | ||
.then( SavedLocation.typifyInstanceResponse ); | ||
} | ||
|
||
static delete( params, options ) { | ||
return iNaturalistAPI.delete( "saved_locations/:id", params, options ); | ||
} | ||
}; | ||
|
||
module.exports = savedLocations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const Model = require( "./model" ); | ||
|
||
const SavedLocation = class SavedLocation extends Model { | ||
static typifyResultsResponse( response ) { | ||
return super.typifyResultsResponse( response, SavedLocation ); | ||
} | ||
|
||
static typifyInstanceResponse( response ) { | ||
return super.typifyInstanceResponse( response, SavedLocation ); | ||
} | ||
}; | ||
|
||
module.exports = SavedLocation; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.