Novo layout
This commit is contained in:
@@ -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 [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user