Novo layout

This commit is contained in:
Marco Santos
2025-07-24 00:07:59 +01:00
parent 11e532ac9a
commit dec8bd3909
24 changed files with 519 additions and 425 deletions

View File

@@ -1,6 +1,7 @@
import axios from 'axios';
import type { AxiosResponse } from 'axios';
import { NIFType } from '../service/api';
import { toast } from 'react-hot-toast';
const API_URL = import.meta.env.VITE_API_URL;
@@ -15,21 +16,24 @@ class GeradorService {
});
return response.data;
} catch (error) {
console.error('Error fetching NIF:', error);
toast.error('Error fetching NIF:' + error.message);
return [];
}
}
static async ValidateNIF(type: string | null): Promise<any[]> {
static async ValidateNIF(nif: string | null): Promise<any[]> {
try {
const response: AxiosResponse = await axios.get(API_URL + 'Generate/ValidateNIF',
{
params: {
type: type
nif: nif
}
});
return response.data;
} catch (error) {
toast.error('Error fetching NIF:' + error);
console.error('Error fetching NIF:', error);
return [];
}