-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Delete Integration, WIP multiple API calling issue * Updated APi calling * fix: Multiple API calling issue
- Loading branch information
1 parent
6aac61a
commit f088202
Showing
7 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
apps/web/app/services/client/api/integrations/integration-tenant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import { IIntegrationTenant, PaginationResponse, CreateResponse } from '@app/interfaces'; | ||
import { IIntegrationTenant, PaginationResponse, CreateResponse, DeleteResponse } from '@app/interfaces'; | ||
import api from '../../axios'; | ||
|
||
export function getIntegrationTenantAPI(name: string) { | ||
return api.get<CreateResponse<PaginationResponse<IIntegrationTenant>>>( | ||
`/integration-tenant/remember/state?name=${name}` | ||
); | ||
} | ||
|
||
export function deleteIntegrationTenantAPI(integrationId: string) { | ||
return api.delete<DeleteResponse>(`/integration-tenant/${integrationId}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { authenticatedGuard } from '@app/services/server/guards/authenticated-guard'; | ||
import { deleteIntegrationTenantRequest } from '@app/services/server/requests'; | ||
import { NextApiRequest, NextApiResponse } from 'next'; | ||
|
||
export default async function handler(req: NextApiRequest, res: NextApiResponse) { | ||
const { $res, user, access_token, tenantId } = await authenticatedGuard(req, res); | ||
if (!user) return $res(); | ||
|
||
const { id } = req.query; | ||
|
||
if (req.method !== 'DELETE') { | ||
return $res.status(405).json({}); | ||
} | ||
|
||
if (id) { | ||
const response = await deleteIntegrationTenantRequest(id as string, tenantId, access_token); | ||
|
||
return $res.status(200).json(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters