fix: remove self and replace with this

This commit is contained in:
Dominik Pschenitschni 2022-02-18 20:26:55 +01:00 committed by kolaente
parent 0e14e3053d
commit 175b786ec6
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 4 deletions

View File

@ -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