Gerador NIF na APP

This commit is contained in:
SECUNDIS\masantos
2024-04-11 22:21:24 +01:00
parent be60a4df8e
commit ed33d7ec28
10 changed files with 191 additions and 29 deletions

View File

@@ -0,0 +1,33 @@
import axios, { AxiosResponse } from 'axios';
const API_URL = 'http://localhost:32769/';
class GeradorService {
static async GenerateNIF(type: string | null): Promise<any[]> {
try {
const response: AxiosResponse = await axios.get(API_URL + 'Generate/GenerateNIF',
{
params: {
type: type
}
});
return response.data;
} catch (error) {
console.error('Error fetching NIF:', error);
return [];
}
}
static async GenerateNISS(): Promise<any[]> {
try {
const response: AxiosResponse = await axios.get(API_URL + 'Generate/GenerateNISS');
return response.data;
} catch (error) {
console.error('Error fetching NIF:', error);
return [];
}
}
}
export default GeradorService;