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
|
||||
const self = this
|
||||
this.http.interceptors.request.use((config) => {
|
||||
switch (config.method) {
|
||||
case 'post':
|
||||
if (this.useUpdateInterceptor()) {
|
||||
config.data = self.beforeUpdate(config.data)
|
||||
config.data = this.beforeUpdate(config.data)
|
||||
config.data = objectToSnakeCase(config.data)
|
||||
}
|
||||
break
|
||||
case 'put':
|
||||
if (this.useCreateInterceptor()) {
|
||||
config.data = self.beforeCreate(config.data)
|
||||
config.data = this.beforeCreate(config.data)
|
||||
config.data = objectToSnakeCase(config.data)
|
||||
}
|
||||
break
|
||||
case 'delete':
|
||||
if (this.useDeleteInterceptor()) {
|
||||
config.data = self.beforeDelete(config.data)
|
||||
config.data = this.beforeDelete(config.data)
|
||||
config.data = objectToSnakeCase(config.data)
|
||||
}
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue