feat: Add document download and upload. Add NFC support and enhance attendance and permits views
- Improved error message handling in LoginScreen for invalid credentials. - Added new images: mariani-icon.png and mariani-splash.png. - Updated AddDocumentModal to handle file extensions and improve UI. - Enhanced CalendarWidget to support month change callbacks. - Introduced NfcScanModal for NFC tag scanning with animations. - Revamped QrScanModal to utilize camera for QR code scanning. - Removed mock data from data.ts and streamlined Office data. - Updated package dependencies for expo-camera and react-native-nfc-manager. - Added utility function to parse seconds to time format. - Refactored document upload logic to use FormData for server uploads.
This commit is contained in:
@ -55,7 +55,7 @@ export default function SiteDocumentsScreen() {
|
||||
|
||||
useEffect(() => {
|
||||
if (params.id) {
|
||||
setIsLoading(true); // Caricamento iniziale
|
||||
setIsLoading(true);
|
||||
fetchSiteDocuments(Number(params.id));
|
||||
}
|
||||
}, [params.id, fetchSiteDocuments]);
|
||||
@ -107,11 +107,10 @@ export default function SiteDocumentsScreen() {
|
||||
const handleUploadDocument = async (file: any, customTitle?: string) => {
|
||||
setIsUploading(true);
|
||||
try {
|
||||
const response = await uploadDocument(file, Number(params.id), customTitle);
|
||||
// console.log('Risposta caricamento:', response.data);
|
||||
// Alert.alert('Successo', 'Documento caricato con successo!');
|
||||
// setShowUploadModal(false);
|
||||
// fetchSiteDocuments(Number(params.id)); // Ricarica la lista dei documenti
|
||||
await uploadDocument(file, Number(params.id), customTitle);
|
||||
Alert.alert('Successo', 'Documento caricato con successo!');
|
||||
setShowUploadModal(false);
|
||||
fetchSiteDocuments(Number(params.id), true);
|
||||
} catch (error) {
|
||||
console.error('Errore nel caricamento del documento:', error);
|
||||
Alert.alert('Errore', 'Impossibile caricare il documento. Riprova più tardi.');
|
||||
|
||||
Reference in New Issue
Block a user