New Layout
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import axios, { AxiosResponse } from 'axios';
|
||||
import axios from 'axios';
|
||||
import type { AxiosResponse } from 'axios';
|
||||
import { NIFType } from '../service/api';
|
||||
|
||||
const API_URL = process.env.REACT_APP_API_URL;
|
||||
const API_URL = import.meta.env.VITE_API_URL;
|
||||
|
||||
class GeradorService {
|
||||
static async GenerateNIF(type: string | null): Promise<any[]> {
|
||||
@@ -18,6 +20,21 @@ class GeradorService {
|
||||
}
|
||||
}
|
||||
|
||||
static async ValidateNIF(type: string | null): Promise<any[]> {
|
||||
try {
|
||||
const response: AxiosResponse = await axios.get(API_URL + 'Generate/ValidateNIF',
|
||||
{
|
||||
params: {
|
||||
type: type
|
||||
}
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching NIF:', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
static async GenerateNISS(): Promise<any[]> {
|
||||
try {
|
||||
|
||||
@@ -28,6 +45,17 @@ class GeradorService {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
static async GenerateCC(): Promise<any[]> {
|
||||
try {
|
||||
|
||||
const response: AxiosResponse = await axios.get(API_URL + 'Generate/GenerateCC');
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching NIF:', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default GeradorService;
|
||||
Reference in New Issue
Block a user