Skip to content

Commit b4d5bcc

Browse files
author
Thomas Dashney
committed
replace this with super in restful endpoints
1 parent e55a090 commit b4d5bcc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/endpoints/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export const restful = (BaseEndpoints: typeof HttpEndpoints) =>
182182
* Returns the path for a given resource id, as a convenience.
183183
*/
184184
static pathToResource(id: ApiParam) {
185-
return this.buildPath(this.singlePath(id))
185+
return super.buildPath(this.singlePath(id))
186186
}
187187

188188
/**
@@ -192,7 +192,7 @@ export const restful = (BaseEndpoints: typeof HttpEndpoints) =>
192192
protected static list<TResponseBody extends ResponseBody = ResponseBody>(
193193
query?: ApiQueryParams
194194
) {
195-
return this.get<TResponseBody>(this.collectionPath, {query})
195+
return super.get<TResponseBody>(this.collectionPath, {query})
196196
}
197197

198198
/**
@@ -201,7 +201,7 @@ export const restful = (BaseEndpoints: typeof HttpEndpoints) =>
201201
protected static create<TResponseBody extends ResponseBody = ResponseBody>(
202202
body?: RequestBody
203203
) {
204-
return this.post<TResponseBody>(this.collectionPath, {body})
204+
return super.post<TResponseBody>(this.collectionPath, {body})
205205
}
206206

207207
/**
@@ -210,7 +210,7 @@ export const restful = (BaseEndpoints: typeof HttpEndpoints) =>
210210
protected static findById<
211211
TResponseBody extends ResponseBody = ResponseBody
212212
>(id: ApiParam) {
213-
return this.get<TResponseBody>(this.singlePath(id))
213+
return super.get<TResponseBody>(this.singlePath(id))
214214
}
215215

216216
/**
@@ -220,7 +220,7 @@ export const restful = (BaseEndpoints: typeof HttpEndpoints) =>
220220
id: ApiParam,
221221
body?: RequestBody
222222
) {
223-
return this.put<TResponseBody>(this.singlePath(id), {body})
223+
return super.put<TResponseBody>(this.singlePath(id), {body})
224224
}
225225

226226
/**
@@ -229,14 +229,14 @@ export const restful = (BaseEndpoints: typeof HttpEndpoints) =>
229229
protected static partialUpdate<
230230
TResponseBody extends ResponseBody = ResponseBody
231231
>(id: ApiParam, body?: RequestBody) {
232-
return this.patch<TResponseBody>(this.singlePath(id), {body})
232+
return super.patch<TResponseBody>(this.singlePath(id), {body})
233233
}
234234

235235
/**
236236
* Performs a `DELETE` at `/:id`, using an optional request `body`
237237
*/
238238
protected static delete(id: ApiParam, body?: RequestBody) {
239-
return this.delete(this.singlePath(id), {body})
239+
return super.delete(this.singlePath(id), {body})
240240
}
241241
}
242242

0 commit comments

Comments
 (0)