Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
fix: deleting applications (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfryan authored Nov 30, 2023
1 parent e3b21cf commit b3202d4
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { getHeaders } from '@/utils/headers';
import { getOrgId } from '@/utils/org';
import type { Application } from '@supaglue/types';
import type { NextApiRequest, NextApiResponse } from 'next';
import { API_HOST, SG_INTERNAL_TOKEN } from '../..';
import { API_HOST } from '../..';

export default async function handler(req: NextApiRequest, res: NextApiResponse<Application | object>) {
switch (req.method) {
Expand Down Expand Up @@ -36,10 +35,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
case 'DELETE': {
const result = await fetch(`${API_HOST}/internal/applications/${req.query.applicationId}`, {
method: 'DELETE',
headers: {
'x-sg-internal-token': SG_INTERNAL_TOKEN,
'x-org-id': getOrgId(req),
},
headers: await getHeaders(req),
});

if (!result.ok) {
Expand Down

0 comments on commit b3202d4

Please sign in to comment.