refactor(geral): implementando gerenciador de erro nos datas

This commit is contained in:
= 2025-09-29 09:24:10 -03:00
parent eeab66149f
commit 7fe725bdeb
4 changed files with 12 additions and 6 deletions

View file

@ -1,9 +1,10 @@
'use server'
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
import API from "@/services/api/Api";
import { Methods } from "@/services/api/enums/ApiMethodEnum";
export default async function TTBAndamentoServicoIndexData() {
async function executeTTBAndamentoServicoIndexData() {
const api = new API();
@ -14,4 +15,6 @@ export default async function TTBAndamentoServicoIndexData() {
return response;
}
}
export const TTBAndamentoServicoIndexData = withClientErrorHandler(executeTTBAndamentoServicoIndexData)

View file

@ -3,8 +3,9 @@
import API from "@/services/api/Api";
import TTBAndamentoServicoInteface from "../../_interfaces/TTBAndamentoServicoInterface";
import { Methods } from "@/services/api/enums/ApiMethodEnum";
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
export default async function TTBAndamentoServicoRemoveData(tTBAndamentoServico: TTBAndamentoServicoInteface) {
async function executeTTBAndamentoServicoRemoveData(tTBAndamentoServico: TTBAndamentoServicoInteface) {
const api = new API();
@ -15,4 +16,6 @@ export default async function TTBAndamentoServicoRemoveData(tTBAndamentoServico:
return response;
}
}
export const TTBAndamentoServicoRemoveData = withClientErrorHandler(executeTTBAndamentoServicoRemoveData)

View file

@ -1,7 +1,7 @@
import { useResponse } from "@/app/_response/ResponseContext"
import { useState } from "react";
import TTBAndamentoServicoInteface from "../../_interfaces/TTBAndamentoServicoInterface";
import TTBAndamentoServicoRemoveData from "../../_data/TTBAndamentoServico/TTBAndamentoServicoRemoveData";
import { TTBAndamentoServicoRemoveData } from "../../_data/TTBAndamentoServico/TTBAndamentoServicoRemoveData";
export const useTTBAndamentoServicoDeleteHook = () => {

View file

@ -3,7 +3,7 @@
import { useResponse } from "@/app/_response/ResponseContext"
import { useState } from "react";
import TTBAndamentoServicoInteface from "../../_interfaces/TTBAndamentoServicoInterface";
import TTBAndamentoServicoIndexData from "../../_data/TTBAndamentoServico/TTBAndamentoServicoIndexData";
import { TTBAndamentoServicoIndexData } from "../../_data/TTBAndamentoServico/TTBAndamentoServicoIndexData";
export const useTTBAndamentoServicoReadHook = () => {