Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
archive (event) {
Dialog.create({
title: this.$t('STOREEDIT.DIALOGS.ARCHIVE.TITLE'),
message: this.$t('STOREEDIT.DIALOGS.ARCHIVE.MESSAGE'),
cancel: this.$t('BUTTON.CANCEL'),
ok: this.$t('STOREEDIT.DIALOGS.ARCHIVE.CONFIRM'),
})
.onOk(() => this.$emit('save', { id: this.value.id, status: 'archived' }, event))
},
},
validations: {
edit: {
name: {
required,
minLength: minLength(3),
maxLength: maxLength(80),
isUnique (value) {
if (value === '') return true
return !this.allPlaces
.filter(e => e.id !== this.edit.id)
.find(e => e.name === value)
},
},
},
},
}
submit () {
this.$v.user.$touch()
if (!this.canSave || this.isPending) return
this.$emit('submit', {
userData: this.user,
joinPlayground: this.joinPlayground,
})
this.$v.user.$reset()
},
},
validations: {
user: {
displayName: {
required,
minLength: minLength(3),
maxLength: maxLength(80),
},
},
},
}
validations() {
return {
title: {
required,
minLength: minLength(1),
maxLength: maxLength(this.titleMaxLength),
notBlank
},
description: {
required,
minLength: minLength(1),
maxLength: maxLength(this.descriptionMaxLength),
notBlank
},
type: {
isValid
},
amount: {
required: x => !!x && x !== `0`,
decimal,
between: between(SMALLEST, atoms(this.balance))
}
}
},
methods: {
}
},
resetFields () {
this.$v.$reset()
this.fields = {
agreement: 'I understand the risks',
repeatAgreement: ''
}
}
},
validations: {
fields: {
repeatAgreement: {
required,
minLength: minLength(22),
maxLength: maxLength(22),
sameAs: sameAs('agreement')
}
}
}
}
}
},
validations: {
formData: {
name: {
required,
minLength: minLength(3)
},
price: {
required,
numeric,
minValue: minValue(0.1),
maxLength: maxLength(10)
},
description: {
maxLength: maxLength(255)
}
}
},
computed: {
...mapGetters('currency', [
'defaultCurrencyForInput'
]),
price: {
get: function () {
return this.formData.price / 100
},
set: function (newValue) {
this.formData.price = newValue * 100
}
},
...mapGetters('modal', [
validations () {
return {
item: {
name: {
required
},
quantity: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
price: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
discount_val: {
between: between(0, this.maxDiscount)
},
description: {
maxLength: maxLength(255)
}
}
}
},
created () {
settingsAccount: {
firstName: {
required,
minLength: minLength(1),
maxLength: maxLength(50)
},
lastName: {
required,
minLength: minLength(1),
maxLength: maxLength(50)
},
email: {
required,
email,
minLength: minLength(5),
maxLength: maxLength(254)
}
}
};
@Component({
validations
})
export default class Settings extends Vue {
public success: string = null;
public error: string = null;
public errorEmailExists: string = null;
public languages: any = this.$store.getters.languages || [];
public save(): void {
this.error = null;
this.errorEmailExists = null;
previewReceipt: null,
fileSendUrl: '/api/expenses'
}
},
validations: {
category: {
required
},
formData: {
expense_date: {
required
},
amount: {
required,
minValue: minValue(0.1),
maxLength: maxLength(20)
},
notes: {
maxLength: maxLength(255)
}
}
},
computed: {
...mapGetters('currency', [
'defaultCurrencyForInput'
]),
amount: {
get: function () {
return this.formData.amount / 100
},
set: function (newValue) {
this.formData.amount = newValue * 100
errorEmailExists: undefined,
errorUserExists: undefined,
registerAccount: {
login: undefined,
email: undefined,
password: undefined
},
success: false
};
},
validations: {
registerAccount: {
login: {
required,
minLength: minLength(1),
maxLength: maxLength(50),
pattern: loginPattern
},
email: {
required,
minLength: minLength(5),
maxLength: maxLength(254),
email
},
password: {
required,
minLength: minLength(4),
maxLength: maxLength(254)
}
},
confirmPassword: {
required,