Skip to content

Commit a12c272

Browse files
author
Philipp
committed
Fixing a bug
1 parent f7f144e commit a12c272

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pmochine/vee-validate-laravel",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Adds simple laravel form validation support to vee-validate",
55
"main": "src/vee-validate-laravel.js",
66
"scripts": {

src/vee-validate-laravel.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
const Plugin = {
42
install(Vue, options = {}) {
53
// adding an instance method
@@ -27,16 +25,16 @@ function addToErrorBag(errorResponse) {
2725
// check if errors exist
2826
if (!hasProperty(errorResponse.data, 'errors')) return null;
2927

30-
return loopThroughErrors(errorResponse.data.errors);
28+
return loopThroughErrors.call(this, errorResponse.data.errors);
3129
}
3230

33-
function hasProperty(obj, key) {
31+
const hasProperty = (obj, key) => {
3432
if (!obj) return false;
3533

3634
const has = Object.prototype.hasOwnProperty;
3735

3836
return has.call(obj, key);
39-
}
37+
};
4038

4139
function loopThroughErrors(errors) {
4240
let firstError = '';

0 commit comments

Comments
 (0)