Enhance worship import functionality: Add support for importing .xlsx files in worship management, updating UI to reflect new file type acceptance. Introduce new parsing logic for NBR planning records and update relevant routes and controllers to handle the new import process.
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 7s
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 7s
This commit is contained in:
@@ -15,13 +15,13 @@
|
||||
<div v-if="showImportSection" class="import-section">
|
||||
<h3>Gottesdienste importieren</h3>
|
||||
<div class="import-content">
|
||||
<label for="import-file">Datei auswählen (.doc, .docx, .csv):</label>
|
||||
<label for="import-file">Datei auswählen (.doc, .docx, .xlsx):</label>
|
||||
<input
|
||||
type="file"
|
||||
id="import-file"
|
||||
ref="fileInput"
|
||||
@change="handleFileSelect"
|
||||
accept=".doc,.docx,.csv"
|
||||
accept=".doc,.docx,.xlsx"
|
||||
/>
|
||||
<div v-if="selectedFile" class="selected-file">
|
||||
Ausgewählte Datei: {{ selectedFile.name }}
|
||||
@@ -730,13 +730,13 @@ export default {
|
||||
handleFileSelect(event) {
|
||||
const file = event.target.files[0];
|
||||
if (file) {
|
||||
// Validierung: .docx (alt) oder .csv (neu) erlauben
|
||||
const allowedExtensions = ['.doc', '.docx', '.csv'];
|
||||
// Validierung: .docx (alt) oder .xlsx (neue NBR-Planung) erlauben
|
||||
const allowedExtensions = ['.doc', '.docx', '.xlsx'];
|
||||
const fileName = file.name.toLowerCase();
|
||||
const isValidFile = allowedExtensions.some(ext => fileName.endsWith(ext));
|
||||
|
||||
if (!isValidFile) {
|
||||
alert('Bitte wählen Sie eine .doc/.docx oder .csv Datei aus.');
|
||||
alert('Bitte wählen Sie eine .doc/.docx oder .xlsx Datei aus.');
|
||||
event.target.value = '';
|
||||
this.selectedFile = null;
|
||||
return;
|
||||
@@ -759,8 +759,8 @@ export default {
|
||||
|
||||
try {
|
||||
const fileName = this.selectedFile.name.toLowerCase();
|
||||
const endpoint = fileName.endsWith('.csv')
|
||||
? '/worships/import/nbr-csv'
|
||||
const endpoint = fileName.endsWith('.xlsx')
|
||||
? '/worships/import/nbr-planning'
|
||||
: '/worships/import';
|
||||
|
||||
const response = await axios.post(endpoint, formData, {
|
||||
|
||||
Reference in New Issue
Block a user