diff --git a/src/app/(protected)/(cadastros)/cadastros/_data/GTBBairro/mockBairro.ts b/src/app/(protected)/(cadastros)/cadastros/_data/GTBBairro/mockBairro.ts deleted file mode 100644 index e19feed..0000000 --- a/src/app/(protected)/(cadastros)/cadastros/_data/GTBBairro/mockBairro.ts +++ /dev/null @@ -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" - } - ] - }); -} diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroIndexService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroIndexService.ts index a58e999..11a9485 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroIndexService.ts +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroIndexService.ts @@ -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; -} \ No newline at end of file +} + +export const GTBBairroIndexService = withClientErrorHandler(executeGTBBairroIndexService) \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroRemoveService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroRemoveService.ts index 59bbe42..60af826 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroRemoveService.ts +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroRemoveService.ts @@ -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; -} \ No newline at end of file +} + +export const GTBBairroRemoveService = withClientErrorHandler(executeGTBBairroRemoveService) \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroSaveService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroSaveService.ts index d37c2a2..0b0e04a 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroSaveService.ts +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_bairro/GTBBairroSaveService.ts @@ -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; -} \ No newline at end of file +} + +export const GTBBairroSaveService = withClientErrorHandler(executeGTBBairroSaveService) \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoIndexService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoIndexService.ts index f23ded7..5b72ba6 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoIndexService.ts +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoIndexService.ts @@ -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; -} \ No newline at end of file +} + +export const GTBRegimeComunhaoIndexService = withClientErrorHandler(executeGTBRegimeComunhaoIndexService) \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoRemoveService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoRemoveService.ts index 06bec9b..aa29d35 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoRemoveService.ts +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoRemoveService.ts @@ -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; -} \ No newline at end of file +} + +export const GTBRegimeComunhaoRemoveService = withClientErrorHandler(executeGTBRegimeComunhaoRemoveService) \ No newline at end of file diff --git a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoSaveService.ts b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoSaveService.ts index f81e5c9..9241107 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoSaveService.ts +++ b/src/app/(protected)/(cadastros)/cadastros/_services/g_tb_regimecomunhao/GTBRegimeComunhaoSaveService.ts @@ -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; -} \ No newline at end of file +} + +export const GTBRegimeComunhaoSaveService = withClientErrorHandler(executeGTBRegimeComunhaoSaveService) \ No newline at end of file