Skip to content

Commit

Permalink
Merge pull request #2091 from ever-co/feat/static-build-support-2
Browse files Browse the repository at this point in the history
Feat/Next-Frontend APIs
  • Loading branch information
evereq authored Jan 15, 2024
2 parents 49f95ef + ad9e605 commit a3bfe0c
Show file tree
Hide file tree
Showing 15 changed files with 349 additions and 321 deletions.
2 changes: 1 addition & 1 deletion apps/web/app/api/integration-tenant/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export async function DELETE(req: Request, { params }: { params: { id: string }
if (id) {
const response = await deleteIntegrationTenantRequest(id as string, tenantId, organizationId, access_token);

return $res(response);
return $res(response.data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export async function GET(req: Request) {
access_token
);

return $res(response);
return $res(response.data);
}
22 changes: 22 additions & 0 deletions apps/web/app/api/integration/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { authenticatedGuard } from '@app/services/server/guards/authenticated-guard-app';
import { getIntegrationRequest } from '@app/services/server/requests/integrations';
import { NextResponse } from 'next/server';

export async function GET(req: Request) {
const res = new NextResponse();
const { $res, user, access_token, tenantId } = await authenticatedGuard(req, res);
if (!user) return NextResponse.json({}, { status: 401 });

const { searchParams } = new URL(req.url);

const response = await getIntegrationRequest(
{
tenantId: tenantId,
integrationTypeId: searchParams.get('integrationTypeId') as string,
searchQuery: searchParams.get('searchQuery') as string
},
access_token
);

return $res(response.data);
}
2 changes: 1 addition & 1 deletion apps/web/app/api/integration/types/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export async function GET(req: Request) {
access_token
);

return $res(response);
return $res(response.data);
}
6 changes: 5 additions & 1 deletion apps/web/app/api/organization-team-join/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ export async function GET(req: Request) {
tenantId,
organizationId
});

return NextResponse.json(requestToJoinData.data);
}

export async function POST(req: Request) {
const body = (await req.json()) as IRequestToJoinCreate;
return NextResponse.json(await requestToJoinRequest(body));

const response = await requestToJoinRequest(body);

return NextResponse.json(response.data);
}
Loading

0 comments on commit a3bfe0c

Please sign in to comment.