Skip to content

Commit 497dcc1

Browse files
committed
API_URL should not contain version suffix
1 parent c74070d commit 497dcc1

File tree

9 files changed

+32
-32
lines changed

9 files changed

+32
-32
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY --from=build /app/dist /usr/share/nginx/html
2323
COPY ./docker/entrypoint.sh /entrypoint.sh
2424
RUN chmod +x /entrypoint.sh
2525

26-
ARG API_URL=http://localhost:8000
26+
ARG API_URL=http://localhost:8000/v1
2727
ENV SYNCMASTER__UI__API_BROWSER_URL=${API_URL}
2828

2929
ENTRYPOINT ["/entrypoint.sh"]

src/entities/auth/api/authService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { AuthUser, LoginRequest, LoginResponse } from './types';
44

55
export const authService = {
66
login: (data: LoginRequest): Promise<LoginResponse> => {
7-
return axiosInstance.postForm('auth/token', data);
7+
return axiosInstance.postForm('v1/auth/token', data);
88
},
99
getCurrentUserInfo: (): Promise<AuthUser> => {
10-
return axiosInstance.get('users/me');
10+
return axiosInstance.get('v1/users/me');
1111
},
1212
};

src/entities/connection/api/connectionService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ import {
1212

1313
export const connectionService = {
1414
getConnections: (params: GetConnectionsRequest): Promise<PaginationResponse<Connection>> => {
15-
return axiosInstance.get('connections', { params });
15+
return axiosInstance.get('v1/connections', { params });
1616
},
1717

1818
getConnection: ({ id }: GetConnectionRequest): Promise<Connection> => {
19-
return axiosInstance.get(`connections/${id}`);
19+
return axiosInstance.get(`v1/connections/${id}`);
2020
},
2121

2222
createConnection: (data: CreateConnectionRequest): Promise<Connection> => {
23-
return axiosInstance.post(`connections`, data);
23+
return axiosInstance.post(`v1/connections`, data);
2424
},
2525

2626
updateConnection: ({ id, ...data }: UpdateConnectionRequest): Promise<Connection> => {
27-
return axiosInstance.put(`connections/${id}`, data);
27+
return axiosInstance.put(`v1/connections/${id}`, data);
2828
},
2929

3030
deleteConnection: ({ id }: DeleteConnectionRequest): Promise<null> => {
31-
return axiosInstance.delete(`connections/${id}`);
31+
return axiosInstance.delete(`v1/connections/${id}`);
3232
},
3333
};

src/entities/group/api/groupService.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,34 @@ import {
1717

1818
export const groupService = {
1919
getGroups: (params: GetGroupsRequest): Promise<PaginationResponse<Group>> => {
20-
return axiosInstance.get('groups', { params });
20+
return axiosInstance.get('v1/groups', { params });
2121
},
2222

2323
getGroup: ({ id }: GetGroupRequest): Promise<Group> => {
24-
return axiosInstance.get(`groups/${id}`);
24+
return axiosInstance.get(`v1/groups/${id}`);
2525
},
2626

2727
createGroup: (data: CreateGroupRequest): Promise<GroupData> => {
28-
return axiosInstance.post(`groups`, data);
28+
return axiosInstance.post(`v1/groups`, data);
2929
},
3030

3131
updateGroup: ({ id, ...data }: UpdateGroupRequest): Promise<GroupData> => {
32-
return axiosInstance.put(`groups/${id}`, data);
32+
return axiosInstance.put(`v1/groups/${id}`, data);
3333
},
3434

3535
getGroupUsers: ({ id }: GetGroupUsersRequest): Promise<PaginationResponse<GroupUser>> => {
36-
return axiosInstance.get(`groups/${id}/users`);
36+
return axiosInstance.get(`v1/groups/${id}/users`);
3737
},
3838

3939
addGroupUser: ({ groupId, userId, ...data }: AddGroupUserRequest): Promise<null> => {
40-
return axiosInstance.post(`groups/${groupId}/users/${userId}`, data);
40+
return axiosInstance.post(`v1/groups/${groupId}/users/${userId}`, data);
4141
},
4242

4343
updateGroupUser: ({ groupId, userId, ...data }: UpdateGroupUserRequest): Promise<null> => {
44-
return axiosInstance.put(`groups/${groupId}/users/${userId}`, data);
44+
return axiosInstance.put(`v1/groups/${groupId}/users/${userId}`, data);
4545
},
4646

4747
deleteGroupUser: ({ groupId, userId }: DeleteGroupUserRequest): Promise<null> => {
48-
return axiosInstance.delete(`groups/${groupId}/users/${userId}`);
48+
return axiosInstance.delete(`v1/groups/${groupId}/users/${userId}`);
4949
},
5050
};

src/entities/queue/api/queueService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ import {
1212

1313
export const queueService = {
1414
getQueues: (params: GetQueuesRequest): Promise<PaginationResponse<Queue>> => {
15-
return axiosInstance.get('queues', { params });
15+
return axiosInstance.get('v1/queues', { params });
1616
},
1717

1818
getQueue: ({ id, ...params }: GetQueueRequest): Promise<Queue> => {
19-
return axiosInstance.get(`queues/${id}`, { params });
19+
return axiosInstance.get(`v1/queues/${id}`, { params });
2020
},
2121

2222
createQueue: (data: CreateQueueRequest): Promise<Queue> => {
23-
return axiosInstance.post(`queues`, data);
23+
return axiosInstance.post(`v1/queues`, data);
2424
},
2525

2626
updateQueue: ({ id, ...data }: UpdateQueueRequest): Promise<Queue> => {
27-
return axiosInstance.put(`queues/${id}`, data);
27+
return axiosInstance.put(`v1/queues/${id}`, data);
2828
},
2929

3030
deleteQueue: ({ id }: DeleteQueueRequest): Promise<null> => {
31-
return axiosInstance.delete(`queues/${id}`);
31+
return axiosInstance.delete(`v1/queues/${id}`);
3232
},
3333
};

src/entities/run/api/runService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { GetRunRequest, Run, GetRunsRequest, CreateRunRequest } from './types';
55

66
export const runService = {
77
getRuns: (params: GetRunsRequest): Promise<PaginationResponse<Run>> => {
8-
return axiosInstance.get('runs', { params });
8+
return axiosInstance.get('v1/runs', { params });
99
},
1010

1111
getRun: ({ id }: GetRunRequest): Promise<Run> => {
12-
return axiosInstance.get(`runs/${id}`);
12+
return axiosInstance.get(`v1/runs/${id}`);
1313
},
1414

1515
createRun: (data: CreateRunRequest): Promise<Run> => {
16-
return axiosInstance.post('runs', data);
16+
return axiosInstance.post('v1/runs', data);
1717
},
1818
};

src/entities/transfer/api/transferService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ import {
1212

1313
export const transferService = {
1414
getTransfers: (params: GetTransfersRequest): Promise<PaginationResponse<Transfer>> => {
15-
return axiosInstance.get('transfers', { params });
15+
return axiosInstance.get('v1/transfers', { params });
1616
},
1717

1818
getTransfer: ({ id }: GetTransferRequest): Promise<Transfer> => {
19-
return axiosInstance.get(`transfers/${id}`);
19+
return axiosInstance.get(`v1/transfers/${id}`);
2020
},
2121

2222
createTransfer: (data: CreateTransferRequest): Promise<Transfer> => {
23-
return axiosInstance.post(`transfers`, data);
23+
return axiosInstance.post(`v1/transfers`, data);
2424
},
2525

2626
updateTransfer: ({ id, ...data }: UpdateTransferRequest): Promise<Transfer> => {
27-
return axiosInstance.put(`transfers/${id}`, data);
27+
return axiosInstance.put(`v1/transfers/${id}`, data);
2828
},
2929

3030
deleteTransfer: ({ id }: DeleteTransferRequest): Promise<null> => {
31-
return axiosInstance.delete(`transfers/${id}`);
31+
return axiosInstance.delete(`v1/transfers/${id}`);
3232
},
3333
};

src/entities/user/api/userService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { GetUserRequest, User, GetUsersRequest } from './types';
55

66
export const userService = {
77
getUsers: (params: GetUsersRequest): Promise<PaginationResponse<User>> => {
8-
return axiosInstance.get('users', { params });
8+
return axiosInstance.get('v1/users', { params });
99
},
1010

1111
getUser: ({ id }: GetUserRequest): Promise<User> => {
12-
return axiosInstance.get(`users/${id}`);
12+
return axiosInstance.get(`v1/users/${id}`);
1313
},
1414
};

src/shared/config/axios/instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import axios from 'axios';
33
import { requestInterceptor, responseSuccessInterceptor } from './interceptors';
44

55
export const axiosInstance = axios.create({
6-
baseURL: window.env?.API_URL || process.env.API_URL || 'http://localhost:8000/v1/',
6+
baseURL: window.env?.API_URL || process.env.API_URL || 'http://localhost:8000',
77
headers: {
88
Accept: 'application/json',
99
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)