Skip to content

Commit 1dadb14

Browse files
authored
Merge pull request #1063 from chantouchsek/bug/1062-types
fix: 🏷️ cast types and fix ternary condition
2 parents 54a706d + 70c0451 commit 1dadb14

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core/BaseService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ export default class BaseService {
9191
const endpoint = endpointPath.replace(/\/\//g, '/')
9292
const url = this.__getParameterString(endpoint)
9393
const axiosConfig = { url, data: formData, method, ...config }
94-
return new Promise<AxiosResponse<AxiosResponse<T>>>((resolve, reject) => {
94+
return new Promise<AxiosResponse<T>>((resolve, reject) => {
9595
this.$http<T>(axiosConfig)
9696
.then((response) => {
9797
this.onSuccess()
9898
if (this.$resetParameter) this.removeParameters()
99-
resolve(response)
99+
resolve(response as AxiosResponse<T>)
100100
})
101101
.catch((error: AxiosError<AxiosResponseData>) => {
102102
this.errors.processing = false

src/core/Validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Validator {
2020

2121
first(field: string | string[]) {
2222
const fields = this.fields(castArray(field))
23-
const foundField = fields.find((f) => has(this.errors, f)) ?? ''
23+
const foundField = fields.find((f) => has(this.errors, f)) || ''
2424
const value = this.get(foundField)
2525
return Array.isArray(value) ? value[0] : value
2626
}

0 commit comments

Comments
 (0)