Skip to content

Commit

Permalink
🐛 Routes naming
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Aug 2, 2024
1 parent 5f9010a commit 20f17d8
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const useProjectConnectors = (id: string,API_URL : string) => {
return useQuery({
queryKey: ['project-connectors', id],
queryFn: async (): Promise<any> => {
const response = await fetch(`${API_URL}/project-connectors?projectId=${id}`);
const response = await fetch(`${API_URL}/project_connectors?projectId=${id}`);
if (!response.ok) {
throw new Error('Network response was not ok');
}
Expand Down
2 changes: 1 addition & 1 deletion apps/magic-link/src/hooks/queries/useProjectConnectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useProjectConnectors = (id: string | null) => {
if (!id) {
throw new Error('Project ID is not available');
}
const response = await fetch(`${config.API_URL}/project-connectors?projectId=${id}`);
const response = await fetch(`${config.API_URL}/project_connectors?projectId=${id}`);
if (!response.ok) {
throw new Error('Network response was not ok');
}
Expand Down
2 changes: 1 addition & 1 deletion apps/magic-link/src/hooks/queries/useUniqueMagicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const useUniqueMagicLink = (id: string | null) => {
if (!id) {
throw new Error('Magic Link ID is not available');
}
const response = await fetch(`${config.API_URL}/magic-links/single?id=${id.trim()}`);
const response = await fetch(`${config.API_URL}/magic_links/single?id=${id.trim()}`);
if (!response.ok) {
throw new Error('Network response was not ok');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface IConnectionStrategyDto {

const useCreateConnectionStrategy = () => {
const add = async (connectionStrategyData: IConnectionStrategyDto) => {
const response = await fetch(`${config.API_URL}/connections-strategies/create`, {
const response = await fetch(`${config.API_URL}/connections_strategies/create`, {
method: 'POST',
body: JSON.stringify(connectionStrategyData),
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/create/useDefineField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IDefineTargetFieldDto{

const useDefineField = () => {
const define = async (data: IDefineTargetFieldDto) => {
const response = await fetch(`${config.API_URL}/field-mappings/define`, {
const response = await fetch(`${config.API_URL}/field_mappings/define`, {
method: 'POST',
body: JSON.stringify(data),
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/create/useMapField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IMapTargetFieldDto {

const useMapField = () => {
const map = async (data: IMapTargetFieldDto) => {
const response = await fetch(`${config.API_URL}/field-mappings/map`, {
const response = await fetch(`${config.API_URL}/field_mappings/map`, {
method: 'POST',
body: JSON.stringify(data),
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface IDeleteConnectionStrategyDto {

const useDeleteConnectionStrategy = () => {
const remove = async (connectionStrategyData: IDeleteConnectionStrategyDto) => {
const response = await fetch(`${config.API_URL}/connections-strategies/delete`, {
const response = await fetch(`${config.API_URL}/connections_strategies/delete`, {
method: 'POST',
body: JSON.stringify({id:connectionStrategyData.id_cs}),
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/get/useConnectionStrategies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useConnectionStrategies = () => {
return useQuery({
queryKey: ['connection-strategies'],
queryFn: async (): Promise<ConnectionStrategies[]> => {
const response = await fetch(`${config.API_URL}/connections-strategies/getConnectionStrategiesForProject`,
const response = await fetch(`${config.API_URL}/connections_strategies/getConnectionStrategiesForProject`,
{
method: 'GET',
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface IGetCSCredentialsData {

const useConnectionStrategyAuthCredentials = () => {
const getCSCredentials = async (data : IGetCSCredentialsData): Promise<string[]> => {
const response = await fetch(`${config.API_URL}/connections-strategies/credentials`,{
const response = await fetch(`${config.API_URL}/connections_strategies/credentials`,{
method: 'POST',
body: JSON.stringify(data),
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/get/useProjectConnectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const useProjectConnectors = (id: string) => {
return useQuery({
queryKey: ['project-connectors'],
queryFn: async (): Promise<ProjectConnector> => {
const response = await fetch(`${config.API_URL}/project-connectors?projectId=${id}`,
const response = await fetch(`${config.API_URL}/project_connectors?projectId=${id}`,
{
method: 'GET',
headers: {
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/src/hooks/update/useUpdateConnectionStrategy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface IUpdateConnectionStrategyDto {
const useUpdateConnectionStrategy = () => {
const update = async (connectionStrategyData: IUpdateConnectionStrategyDto) => {
if(connectionStrategyData.updateToggle) {
const response = await fetch(`${config.API_URL}/connections-strategies/toggle`, {
const response = await fetch(`${config.API_URL}/connections_strategies/toggle`, {
method: 'POST',
body: JSON.stringify({id_cs:connectionStrategyData.id_cs}),
headers: {
Expand All @@ -30,7 +30,7 @@ const useUpdateConnectionStrategy = () => {
}
return response.json();
} else {
const response = await fetch(`${config.API_URL}/connections-strategies/update`, {
const response = await fetch(`${config.API_URL}/connections_strategies/update`, {
method: 'POST',
body: JSON.stringify({
id_cs:connectionStrategyData.id_cs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface IUpdateProjectConnectorsDto {

const useUpdateProjectConnectors = () => {
const update = async (data: IUpdateProjectConnectorsDto) => {
const response = await fetch(`${config.API_URL}/project-connectors`, {
const response = await fetch(`${config.API_URL}/project_connectors`, {
method: 'POST',
body: JSON.stringify(data),
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import {
} from './dto/managed-webhooks.dto';
import { ManagedWebhooksService } from './managed-webhooks.service';

@ApiTags('managed-webhooks')
@ApiTags('managed_webhooks')
@ApiExcludeController()
@Controller('managed-webhooks')
@Controller('managed_webhooks')
export class ManagedWebhooksController {
constructor(
private managedWebhookService: ManagedWebhooksService,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/@core/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class AuthController {
@ApiBody({ type: ApiKeyDto })
@ApiResponse({ status: 201 })
@UseGuards(JwtAuthGuard)
@Post()
@Post('api_keys')
async generateApiKey(@Body() data: ApiKeyDto): Promise<{ api_key: string }> {
return this.authService.generateApiKeyForUser(
data.userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
import { ProjectConnectorsService } from './project-connectors.service';
import { ProjectConnectorsDto } from './dto/project-connectors.dto';
import { JwtAuthGuard } from '@@core/auth/guards/jwt-auth.guard';
@ApiTags('project-connectors')
@ApiTags('project_connectors')
@ApiExcludeController()
@Controller('project-connectors')
@Controller('project_connectors')
export class ProjectConnectorsController {
constructor(
private readonly projectConnectorsService: ProjectConnectorsService,
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/authUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const handleOAuth2Url = async (input: HandleOAuth2Url) => {
// 1. env if selfhost and no custom
// 2. backend if custom credentials
// same for authBaseUrl with subdomain
const DATA = await fetch(`${apiUrl}/connections-strategies/getCredentials?projectId=${projectId}&type=${type}`);
const DATA = await fetch(`${apiUrl}/connections_strategies/getCredentials?projectId=${projectId}&type=${type}`);
const data = await DATA.json() as OAuth2AuthData;

// console.log("Fetched Data ", JSON.stringify(data))
Expand Down

0 comments on commit 20f17d8

Please sign in to comment.