Skip to content

Commit

Permalink
Use correct type for listSystems() (#16)
Browse files Browse the repository at this point in the history
* Use correct type for listSystems()

* Update README.md

Co-authored-by: Vitaliy Isikov <[email protected]>
  • Loading branch information
codyduong and notVitaliy authored Apr 22, 2021
1 parent 0080636 commit 14b393a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ spaceTraders.listLocations(system?: string, type?: string): Promise<LocationsRes
Get systems info

```typescript
spaceTraders.listSystems(): Promise<LocationResponse>
spaceTraders.listSystems(): Promise<SystemsResponse>
```

### [payBackLoan](https://api.spacetraders.io/#api-loans)
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
StatusResponse,
TokenResponse,
JettisonResponse,
SystemsResponse,
AvailableStructureResponse,
CreateStructureResponse,
Good,
Expand Down Expand Up @@ -148,7 +149,7 @@ export class SpaceTraders {
listSystems() {
const url = '/game/systems'

return this.makeAuthRequest<LocationResponse>(url, 'get')
return this.makeAuthRequest<SystemsResponse>(url, 'get')
}

listLocations(system: string = 'OE', type?: string, allowsConstruction?: boolean) {
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export interface ShipsResponse {
}

export interface SystemsResponse {
systems: System
systems: System[]
}

export interface TokenResponse {
Expand Down

0 comments on commit 14b393a

Please sign in to comment.