Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac49c86f53 |
9 changed files with 36 additions and 18 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import API from "@/services/api/Api";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
|
||||
export default async function GTBProfissoesIndexData() {
|
||||
async function executeGTBProfissoesIndexData() {
|
||||
|
||||
const api = new API();
|
||||
|
||||
|
|
@ -9,4 +10,6 @@ export default async function GTBProfissoesIndexData() {
|
|||
method: Methods.GET,
|
||||
endpoint: `administrativo/g_tb_profissao/`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBProfissoesIndexData = withClientErrorHandler(executeGTBProfissoesIndexData)
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import API from "@/services/api/Api";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
export default async function GTBProfissaoRemoveData(data: GTBProfissaoInterface) {
|
||||
async function executeGTBProfissaoRemoveData(data: GTBProfissaoInterface) {
|
||||
|
||||
const api = new API();
|
||||
|
||||
|
|
@ -11,4 +12,6 @@ export default async function GTBProfissaoRemoveData(data: GTBProfissaoInterface
|
|||
endpoint: `administrativo/g_tb_profissao/${data.tb_profissao_id}`
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBProfissaoRemoveData = withClientErrorHandler(executeGTBProfissaoRemoveData)
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import API from "@/services/api/Api";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
import { Methods } from "@/services/api/enums/ApiMethodEnum";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
|
||||
export default async function GTBProfissaoSaveData(data: GTBProfissaoInterface) {
|
||||
async function executeGTBProfissaoSaveData(data: GTBProfissaoInterface) {
|
||||
|
||||
const isUpdate = Boolean(data.tb_profissao_id);
|
||||
|
||||
|
|
@ -14,4 +15,6 @@ export default async function GTBProfissaoSaveData(data: GTBProfissaoInterface)
|
|||
body: data
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBProfissaoSaveData = withClientErrorHandler(executeGTBProfissaoSaveData)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext"
|
||||
import { useState } from "react";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
import GTBProfissaoIndexService from "../../_services/g_tb_profissao/GTBProfissaoIndexService";
|
||||
import { GTBProfissaoIndexService } from "../../_services/g_tb_profissao/GTBProfissaoIndexService";
|
||||
|
||||
export const useGTBProfissaoReadHook = () => {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext"
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
import GTBProfissaoRemoveService from "../../_services/g_tb_profissao/GTBProfissaoRemoveService";
|
||||
import { GTBProfissaoRemoveService } from "../../_services/g_tb_profissao/GTBProfissaoRemoveService";
|
||||
|
||||
export const useGTBProfissaoRemoveHook = () => {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useResponse } from "@/app/_response/ResponseContext"
|
||||
import { useState } from "react";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
import GTBProfissaoSaveService from "../../_services/g_tb_profissao/GTBProfissaoSaveService";
|
||||
import { GTBProfissaoSaveService } from "../../_services/g_tb_profissao/GTBProfissaoSaveService";
|
||||
|
||||
export const useGTBProfissaoSaveHook = () => {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import GTBProfissoesIndexData from "../../_data/GTBProfissao/GTBProfissaoIndexData";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import { GTBProfissoesIndexData } from "../../_data/GTBProfissao/GTBProfissaoIndexData";
|
||||
|
||||
export default async function GTBProfissaoIndexService() {
|
||||
async function executeGTBProfissaoIndexService() {
|
||||
|
||||
const response = await GTBProfissoesIndexData();
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBProfissaoIndexService = withClientErrorHandler(executeGTBProfissaoIndexService)
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
import GTBProfissaoRemoveData from "../../_data/GTBProfissao/GTBProfissaoRemoveData";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import { GTBProfissaoRemoveData } from "../../_data/GTBProfissao/GTBProfissaoRemoveData";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
|
||||
export default async function GTBProfissaoRemoveService(data: GTBProfissaoInterface) {
|
||||
async function executeGTBProfissaoRemoveService(data: GTBProfissaoInterface) {
|
||||
|
||||
const response = await GTBProfissaoRemoveData(data);
|
||||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBProfissaoRemoveService = withClientErrorHandler(executeGTBProfissaoRemoveService)
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
import GTBProfissaoSaveData from "../../_data/GTBProfissao/GTBProfissaoSaveData";
|
||||
import { withClientErrorHandler } from "@/actions/withClientErrorHandler/withClientErrorHandler";
|
||||
import { GTBProfissaoSaveData } from "../../_data/GTBProfissao/GTBProfissaoSaveData";
|
||||
import GTBProfissaoInterface from "../../_interfaces/GTBProfissaoInterface";
|
||||
|
||||
export default async function GTProfissaoSaveService(data: GTBProfissaoInterface) {
|
||||
async function executeGTBProfissaoSaveService(data: GTBProfissaoInterface) {
|
||||
|
||||
const response = await GTBProfissaoSaveData(data);
|
||||
|
||||
|
|
@ -9,4 +10,6 @@ export default async function GTProfissaoSaveService(data: GTBProfissaoInterface
|
|||
|
||||
return response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const GTBProfissaoSaveService = withClientErrorHandler(executeGTBProfissaoSaveService)
|
||||
Loading…
Add table
Reference in a new issue