[MVPTN-70] refactor(geral): implementando gerenciador de erro e removendo mock
This commit is contained in:
parent
c7f86522fb
commit
0e35db30c0
7 changed files with 30 additions and 58 deletions
|
|
@ -1,46 +0,0 @@
|
|||
import { GTBBairroInterface } from "../../_interfaces/GTBBairroInterface";
|
||||
|
||||
export default async function BairroMockDeDados() {
|
||||
return Promise.resolve({
|
||||
status: 200,
|
||||
message: 'Dados localizados',
|
||||
data: [
|
||||
{
|
||||
sistema_id: 1.00,
|
||||
tb_bairro_id: 390.00,
|
||||
descricao: "AV. RUI BARBOSA",
|
||||
situacao: "A"
|
||||
},
|
||||
{
|
||||
sistema_id: 1.00,
|
||||
tb_bairro_id: 391.00,
|
||||
descricao: "AV. PRESIDENTE DUTRA",
|
||||
situacao: "A"
|
||||
},
|
||||
{
|
||||
sistema_id: 1.00,
|
||||
tb_bairro_id: 392.00,
|
||||
descricao: "LOTEAMENTO CIDADE MARA ROSA",
|
||||
situacao: "A"
|
||||
},
|
||||
{
|
||||
sistema_id: 1.00,
|
||||
tb_bairro_id: 393.00,
|
||||
descricao: "LOTEAMENTO BENEDITO COELHO FURTADO",
|
||||
situacao: "A"
|
||||
},
|
||||
{
|
||||
sistema_id: 1.00,
|
||||
tb_bairro_id: 394.00,
|
||||
descricao: "RUA 15 DE NOVEMBRO",
|
||||
situacao: "A"
|
||||
},
|
||||
{
|
||||
sistema_id: 1.00,
|
||||
tb_bairro_id: 395.00,
|
||||
descricao: "PRACA JOSÉ MAURICIO DE MOURA",
|
||||
situacao: "A"
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import GTBBairroIndexData from "../../_data/GTBBairro/GTBBairroIndexData";
|
||||
|
||||
export default async function GTBBairroIndexService() {
|
||||
async function executeGTBBairroIndexService() {
|
||||
|
||||
const response = await GTBBairroIndexData();
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBBairroIndexService = withClientErrorHandler(executeGTBBairroIndexService)
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import GTBBairroRemoveData from "../../_data/GTBBairro/GTBBairroRemoveData";
|
||||
import { GTBBairroInterface } from "../../_interfaces/GTBBairroInterface";
|
||||
|
||||
export default async function GTBBairroRemoveService(data: GTBBairroInterface) {
|
||||
async function executeGTBBairroRemoveService(data: GTBBairroInterface) {
|
||||
|
||||
const response = await GTBBairroRemoveData(data);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBBairroRemoveService = withClientErrorHandler(executeGTBBairroRemoveService)
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import GTBBairroSaveData from "../../_data/GTBBairro/GTBBairroSaveData";
|
||||
import { GTBBairroInterface } from "../../_interfaces/GTBBairroInterface";
|
||||
|
||||
export default async function GTBBairroSaveService(data: GTBBairroInterface) {
|
||||
async function executeGTBBairroSaveService(data: GTBBairroInterface) {
|
||||
|
||||
const response = await GTBBairroSaveData(data);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBBairroSaveService = withClientErrorHandler(executeGTBBairroSaveService)
|
||||
|
|
@ -1,9 +1,12 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import GTBRegimeComunhaoIndexData from "../../_data/GTRegimeComunhao/GTBRegimeComunhaoIndexData";
|
||||
|
||||
export default async function GTBRegimeComunhaoIndexService() {
|
||||
async function executeGTBRegimeComunhaoIndexService() {
|
||||
|
||||
const response = await GTBRegimeComunhaoIndexData();
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBRegimeComunhaoIndexService = withClientErrorHandler(executeGTBRegimeComunhaoIndexService)
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import GTBRegimeComunhaoRemoveData from "../../_data/GTRegimeComunhao/GTBRegimeComunhaoRemoveData";
|
||||
import GTBRegimeComunhaoInterface from "../../_interfaces/GTBRegimeComunhaoInterface";
|
||||
|
||||
export default async function GTBRegimeComunhaoRemoveService(data: GTBRegimeComunhaoInterface) {
|
||||
async function executeGTBRegimeComunhaoRemoveService(data: GTBRegimeComunhaoInterface) {
|
||||
|
||||
const response = await GTBRegimeComunhaoRemoveData(data);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBRegimeComunhaoRemoveService = withClientErrorHandler(executeGTBRegimeComunhaoRemoveService)
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import GTBRegimeComunhaoSaveData from "../../_data/GTRegimeComunhao/GTBRegimeComunhaoSaveData";
|
||||
import GTBRegimeComunhaoInterface from "../../_interfaces/GTBRegimeComunhaoInterface";
|
||||
|
||||
export default async function GTBRegimeComunhaoSaveService(data: GTBRegimeComunhaoInterface) {
|
||||
async function executeGTBRegimeComunhaoSaveService(data: GTBRegimeComunhaoInterface) {
|
||||
|
||||
const response = await GTBRegimeComunhaoSaveData(data);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBRegimeComunhaoSaveService = withClientErrorHandler(executeGTBRegimeComunhaoSaveService)
|
||||
Loading…
Add table
Reference in a new issue