Skip to content

Commit ca73a73

Browse files
committed
fix(leaderboard): update URI prefix
1 parent e691ae8 commit ca73a73

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/leaderboard.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ AV.Leaderboard.createLeaderboard = (
121121
) =>
122122
request({
123123
method: 'POST',
124-
path: '/play/leaderboards',
124+
path: '/leaderboard/leaderboards',
125125
data: {
126126
statisticName,
127127
order,
@@ -154,7 +154,7 @@ AV.Leaderboard.getStatistics = (user, { statisticNames } = {}, authOptions) =>
154154
if (!(user && user.id)) throw new Error('user must be an AV.User');
155155
return request({
156156
method: 'GET',
157-
path: `/play/users/${user.id}/statistics`,
157+
path: `/leaderboard/users/${user.id}/statistics`,
158158
query: {
159159
statistics: statisticNames ? ensureArray(statisticNames) : undefined,
160160
},
@@ -186,7 +186,7 @@ AV.Leaderboard.updateStatistics = (user, statistics, authOptions) =>
186186
}));
187187
return request({
188188
method: 'POST',
189-
path: `/play/users/${user.id}/statistics`,
189+
path: `/leaderboard/users/${user.id}/statistics`,
190190
data,
191191
authOptions,
192192
}).then(({ results }) =>
@@ -228,14 +228,14 @@ _.extend(
228228
fetch(authOptions) {
229229
return request({
230230
method: 'GET',
231-
path: `/play/leaderboards/${this.statisticName}`,
231+
path: `/leaderboard/leaderboards/${this.statisticName}`,
232232
authOptions,
233233
}).then(data => this._finishFetch(data));
234234
},
235235
_getResults({ skip, limit, includeUserKeys }, authOptions, self) {
236236
return request({
237237
method: 'GET',
238-
path: `/play/leaderboards/${this.statisticName}/positions${
238+
path: `/leaderboard/leaderboards/${this.statisticName}/positions${
239239
self ? '/self' : ''
240240
}`,
241241
query: {
@@ -284,7 +284,7 @@ _.extend(
284284
_update(data, authOptions) {
285285
return request({
286286
method: 'PUT',
287-
path: `/play/leaderboards/${this.statisticName}`,
287+
path: `/leaderboard/leaderboards/${this.statisticName}`,
288288
data,
289289
authOptions,
290290
}).then(result => this._finishFetch(result));
@@ -315,7 +315,9 @@ _.extend(
315315
reset(authOptions) {
316316
return request({
317317
method: 'PUT',
318-
path: `/play/leaderboards/${this.statisticName}/incrementVersion`,
318+
path: `/leaderboard/leaderboards/${
319+
this.statisticName
320+
}/incrementVersion`,
319321
authOptions,
320322
}).then(data => this._finishFetch(data));
321323
},

test/leaderboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe('Leaderboard', () => {
153153
after(() =>
154154
AV.request({
155155
method: 'DELETE',
156-
path: `/play/leaderboards/${statisticName}`,
156+
path: `/leaderboard/leaderboards/${statisticName}`,
157157
authOptions: {
158158
useMasterKey: true,
159159
},

0 commit comments

Comments
 (0)