-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1747 from ever-co/develop
Release
- Loading branch information
Showing
8 changed files
with
87 additions
and
8 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
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