Skip to content

Commit

Permalink
feat(Contract): delete contract action (#912)
Browse files Browse the repository at this point in the history
  • Loading branch information
ertugrulcan-ays authored Dec 4, 2024
2 parents 6a99e02 + f5955e2 commit a8b016e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use server";
import { structuredError, structuredResponse } from "src/lib";
import { getApiRequests } from "../api-requests";

export async function deleteMerchantContractHeaderByIdApi(id: string) {
try {
const requests = await getApiRequests();
const response = await requests.merchants.deleteContractHeadersById(id);
return structuredResponse(response);
} catch (error) {
return structuredError(error);
}
}
4 changes: 4 additions & 0 deletions apps/web/src/app/[lang]/app/actions/api-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ export async function getApiRequests() {
await contractsClient.contractsMerchant.putApiContractServiceMerchantsContractsContractSettingsById(
data,
),
deleteContractHeadersById: async (id: string) =>
await contractsClient.contractsMerchant.deleteApiContractServiceMerchantsContractsContractHeadersById(
{ id },
),
deleteContractSettingsById: async (id: string) =>
await contractsClient.contractsMerchant.deleteApiContractServiceMerchantsContractsContractSettingsById(
{ id },
Expand Down

0 comments on commit a8b016e

Please sign in to comment.