Commit c91a4f65 authored by Omar Elkadi's avatar Omar Elkadi
Browse files

change the alert theme

parent 1af21d2f
......@@ -153,7 +153,7 @@
<script lang="ts">
import axios from 'axios'
import Swal from 'sweetalert2/dist/sweetalert2.js'
import Swal from 'sweetalert2'
export default {
name: 'SickForm',
......@@ -439,27 +439,32 @@ export default {
const sizeLimit = 2000000 // 2 megabyte
const fileExtension = file.name.split('.').pop()
console.log(fileExtension)
if (!allowedExtentions.includes(fileExtension)) { // extention validation
this.$refs.file.value = null // delete the file from selection
Swal.fire({
title: 'Fehler!',
text: 'Die Datei muss jpg, jpeg, png oder pdf',
icon: 'error'
icon: 'error',
confirmButtonColor: '#1a4273',
background: '#dadada'
})
} else if (file.size > sizeLimit) { // size validation
this.$refs.file.value = null
Swal.fire({
title: 'Fehler!',
text: 'Die Datei ist zu Groß',
icon: 'error'
icon: 'error',
confirmButtonColor: '#1a4273',
background: '#dadada'
}
)
} else { // if valid then load the file in our valiable
Swal.fire({
title: 'Super!',
text: 'Die Datei wurde erfolgreich geladen',
icon: 'success'
icon: 'success',
confirmButtonColor: '#1a4273',
background: '#dadada'
})
this.EvidenceFile = file
}
......@@ -489,7 +494,9 @@ export default {
Swal.fire({
title: 'Gesandet!',
text: 'Danke für Ihre Meldung',
icon: 'success'
icon: 'success',
confirmButtonColor: '#1a4273',
background: '#dadada'
})
// reset the form
event.target.reset()
......
......@@ -3,9 +3,9 @@
"./src/**/*"
],
"compilerOptions": {
"module": "es2015",
"module": "esNEXT",
"moduleResolution": "node",
"target": "es6",
"target": "esNEXT",
"sourceMap": true,
"allowJs": true
}
......
......@@ -5,8 +5,8 @@ module.exports = {
// override vscode settings
// Notice: It only affects the settings used by Vetur.
settings: {
"vetur.useWorkspaceDependencies": true,
"vetur.experimental.templateInterpolationService": true
'vetur.useWorkspaceDependencies': true,
'vetur.experimental.templateInterpolationService': true
},
// **optional** default: `[{ root: './' }]`
// support monorepos
......@@ -39,4 +39,4 @@ module.exports = {
]
}
]
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment