refactor(geral): implementando gerenciador de erro nos datas
This commit is contained in:
parent
eeab66149f
commit
3df00e38bc
6 changed files with 18 additions and 9 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import API from "@/services/api/Api";
|
||||
import TTBReconhecimentoTipoInterface from "../../_interfaces/TTBReconhecimentoTipoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
export default async function TTBReconhecimentoTipoDeleteData(data: TTBReconhecimentoTipoInterface) {
|
||||
async function executeTTBReconhecimentoTipoDeleteData(data: TTBReconhecimentoTipoInterface) {
|
||||
|
||||
const api = new API();
|
||||
|
||||
|
|
@ -13,4 +14,6 @@ export default async function TTBReconhecimentoTipoDeleteData(data: TTBReconheci
|
|||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const TTBReconhecimentoTipoDeleteData = withClientErrorHandler(executeTTBReconhecimentoTipoDeleteData)
|
||||
|
|
@ -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 TTBReconhecimentoTipoIndexData() {
|
||||
async function executeTTBReconhecimentoTipoIndexData() {
|
||||
|
||||
const api = new API();
|
||||
|
||||
|
|
@ -14,4 +15,6 @@ export default async function TTBReconhecimentoTipoIndexData() {
|
|||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const TTBReconhecimentoTipoIndexData = withClientErrorHandler(executeTTBReconhecimentoTipoIndexData)
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import TTBReconhecimentoTipoInterface from "../../_interfaces/TTBReconhecimentoTipoInterface";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
export default async function TTBReconhecimentoTipoSaveData(data: TTBReconhecimentoTipoInterface) {
|
||||
async function executeTTBReconhecimentoTipoSaveData(data: TTBReconhecimentoTipoInterface) {
|
||||
|
||||
const api = new API();
|
||||
|
||||
|
|
@ -14,4 +15,6 @@ export default async function TTBReconhecimentoTipoSaveData(data: TTBReconhecime
|
|||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const TTBReconhecimentoTipoSaveData = withClientErrorHandler(executeTTBReconhecimentoTipoSaveData)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext"
|
||||
import TTBReconhecimentoTipoInterface from "../../_interfaces/TTBReconhecimentoTipoInterface";
|
||||
import TTBReconhecimentoTipoDeleteData from "../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoDeleteData";
|
||||
import { TTBReconhecimentoTipoDeleteData } from "../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoDeleteData";
|
||||
|
||||
export const useTTBReconhecimentoTipoDeleteHook = () => {
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import ITTTBReconhecimentoTipo from '../../_interfaces/TTBReconhecimentoTipoInterface'
|
||||
import { useResponse } from "@/app/_response/ResponseContext"
|
||||
import { useState } from "react";
|
||||
import TTBReconhecimentoTipoIndexData from '../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndexData';
|
||||
import { TTBReconhecimentoTipoIndexData } from '../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndexData';
|
||||
|
||||
export const useTTBReconhecimentoTipoReadHook = () => {
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext"
|
||||
import { useState } from "react";
|
||||
import ITTTBReconhecimentoTipo from '../../_interfaces/TTBReconhecimentoTipoInterface'
|
||||
import TTBReconhecimentoTipoSaveData from "../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoSaveData";
|
||||
import { TTBReconhecimentoTipoSaveData } from "../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoSaveData";
|
||||
|
||||
export const useTTBReconhecimentoTipoSaveHook = () => {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue