fix: remove self and replace with this
This commit is contained in:
parent
0e14e3053d
commit
175b786ec6
1 changed files with 3 additions and 4 deletions
|
@ -64,24 +64,23 @@ export default class AbstractService {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Set the interceptors to process every request
|
// Set the interceptors to process every request
|
||||||
const self = this
|
|
||||||
this.http.interceptors.request.use((config) => {
|
this.http.interceptors.request.use((config) => {
|
||||||
switch (config.method) {
|
switch (config.method) {
|
||||||
case 'post':
|
case 'post':
|
||||||
if (this.useUpdateInterceptor()) {
|
if (this.useUpdateInterceptor()) {
|
||||||
config.data = self.beforeUpdate(config.data)
|
config.data = this.beforeUpdate(config.data)
|
||||||
config.data = objectToSnakeCase(config.data)
|
config.data = objectToSnakeCase(config.data)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'put':
|
case 'put':
|
||||||
if (this.useCreateInterceptor()) {
|
if (this.useCreateInterceptor()) {
|
||||||
config.data = self.beforeCreate(config.data)
|
config.data = this.beforeCreate(config.data)
|
||||||
config.data = objectToSnakeCase(config.data)
|
config.data = objectToSnakeCase(config.data)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'delete':
|
case 'delete':
|
||||||
if (this.useDeleteInterceptor()) {
|
if (this.useDeleteInterceptor()) {
|
||||||
config.data = self.beforeDelete(config.data)
|
config.data = this.beforeDelete(config.data)
|
||||||
config.data = objectToSnakeCase(config.data)
|
config.data = objectToSnakeCase(config.data)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue