Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 53fc629

Browse files
Merge pull request #2 from Chalkin/implement-axios-interceptor
Implemented axios interceptor
2 parents d51ceb3 + 9d05e75 commit 53fc629

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ class Validator{
1717
});
1818
});
1919
}
20+
21+
if (axios) {
22+
axios.interceptors.response.use((response) => {
23+
return response;
24+
}, (error) => {
25+
if (error.response.status === 422) {
26+
Errors.fill(error.response.data.errors)
27+
}
28+
29+
return Promise.reject(error);
30+
});
31+
}
2032

2133
Vue.mixin({
2234

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /