Skip to content

Commit 65d0fc3

Browse files
committed
### [1.0.4] - 2024-03-24
- Django `get` API response handling bug
1 parent 8358f9e commit 65d0fc3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
## [Released]
1616

17+
### [1.0.4] - 2024-03-24
18+
- Django `get` API response handling bug
19+
20+
1721
### [1.0.3] - 2024-03-24
1822
- Logging improvements
1923

src/api/django_service/methods/get.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ export default class DjangoGet<Model, TypeFilters extends object | null = null>
166166
protected async handlePaginatedResponse (apiResponse: ApiResponse<Model[]>, combineLists: boolean = false): Promise<ApiResponse<Model[]>> {
167167
try {
168168
const responseData = apiResponse.response.data as { count: number, next: string, previous: string }
169-
this.count = responseData.count
170-
this.next = responseData.next
171-
this.prev = responseData.previous
169+
if (!!responseData) {
170+
this.count = responseData.count
171+
this.next = responseData.next
172+
this.prev = responseData.previous
173+
}
172174

173175
if (!combineLists) {
174176
this.list = apiResponse.obj ?? []

0 commit comments

Comments
 (0)