Skip to content

Commit cfd832b

Browse files
committed
fix(devicepreferences): unwrap paged items in response
1 parent 7a48f42 commit cfd832b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/endpoint/devicepreferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class DevicePreferencesEndpoint extends Endpoint {
198198
}
199199

200200
public listTranslations(preferenceId: PreferenceId): Promise<LocaleReference[]> {
201-
return this.client.get(`${preferenceId}/i18n`)
201+
return this.client.getPagedItems(`${preferenceId}/i18n`)
202202
}
203203

204204
public updateTranslations(preferenceId: PreferenceId, localization: PreferenceLocalization): Promise<PreferenceLocalization> {

test/unit/devicepreferences.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ describe('devicepreferences', () => {
143143
})
144144

145145
test('list', async () => {
146-
getSpy.mockResolvedValueOnce(MOCK_LOCALE_LIST)
146+
getPagedItemsSpy.mockResolvedValueOnce(MOCK_LOCALE_LIST)
147147

148148
const response = await devicepreferences.listTranslations(preferenceId)
149149

150-
expect(getSpy).toBeCalledWith(`${preferenceId}/i18n`)
150+
expect(getPagedItemsSpy).toBeCalledWith(`${preferenceId}/i18n`)
151151
expect(response).toStrictEqual(MOCK_LOCALE_LIST)
152152
})
153153

154154
test('list failure', async () => {
155-
getSpy.mockRejectedValueOnce(error)
155+
getPagedItemsSpy.mockRejectedValueOnce(error)
156156

157157
const promise = devicepreferences.listTranslations(preferenceId)
158158

0 commit comments

Comments
 (0)