Skip to content

Commit e330974

Browse files
authored
Merge branch 'development' into fix/th-140-email-length
2 parents 7f90786 + efdb8d4 commit e330974

File tree

6 files changed

+2
-147
lines changed

6 files changed

+2
-147
lines changed

backend/src/packages/users/user.controller.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ class UserController extends Controller {
3434

3535
this.userService = userService;
3636

37-
this.addRoute({
38-
path: UsersApiPath.ROOT,
39-
method: 'GET',
40-
handler: () => this.findAll(),
41-
});
42-
4337
this.addRoute({
4438
path: UsersApiPath.$ID,
4539
method: 'GET',
@@ -53,33 +47,6 @@ class UserController extends Controller {
5347
});
5448
}
5549

56-
/**
57-
* @swagger
58-
* /users:
59-
* get:
60-
* description: Returns an array of users
61-
* responses:
62-
* 200:
63-
* description: Successful operation
64-
* content:
65-
* application/json:
66-
* schema:
67-
* type: array
68-
* items:
69-
* $ref: '#/components/schemas/User'
70-
*/
71-
private async findAll(): Promise<ApiHandlerResponse> {
72-
const result = await this.userService.findAll();
73-
74-
return {
75-
status: HttpCode.OK,
76-
payload: {
77-
items: result,
78-
totalCount: result.length,
79-
},
80-
};
81-
}
82-
8350
private async findById(
8451
options: ApiHandlerOptions<{
8552
params: { id: UserEntityT['id'] };

frontend/src/libs/components/app/app.tsx

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,22 @@
11
import 'react-toastify/dist/ReactToastify.css';
22

33
import { Header, RouterOutlet } from '~/libs/components/components.js';
4-
import { AppRoute } from '~/libs/enums/enums.js';
5-
import {
6-
useAppDispatch,
7-
useAppSelector,
8-
useEffect,
9-
useLocation,
10-
useState,
11-
} from '~/libs/hooks/hooks.js';
4+
import { useEffect } from '~/libs/hooks/hooks.js';
125
import { socket as socketService } from '~/libs/packages/socket/socket.js';
13-
import { actions as userActions } from '~/slices/users/users.js';
146

157
const App: React.FC = () => {
16-
const { pathname } = useLocation();
17-
const dispatch = useAppDispatch();
18-
const [isWebSocketsConnected, setIsWebSocketsConnected] = useState(false);
19-
const { users, dataStatus } = useAppSelector(({ users }) => ({
20-
users: users.users,
21-
dataStatus: users.dataStatus,
22-
}));
23-
24-
const isRoot = pathname === AppRoute.ROOT;
25-
268
useEffect(() => {
279
socketService.connect();
2810

29-
socketService.addListener('CONNECT', () => {
30-
setIsWebSocketsConnected(true);
31-
});
32-
3311
return () => {
3412
socketService.disconnect();
3513
};
3614
}, []);
3715

38-
useEffect(() => {
39-
if (isRoot) {
40-
void dispatch(userActions.loadAll());
41-
}
42-
}, [isRoot, dispatch]);
43-
4416
return (
4517
<>
4618
<Header />
47-
<div>
48-
<RouterOutlet />
49-
</div>
50-
{isRoot && (
51-
<>
52-
<h2>Users:</h2>
53-
<h3>Status: {dataStatus}</h3>
54-
<h3>
55-
Socket: {isWebSocketsConnected ? 'connected' : 'disconnected'}
56-
</h3>
57-
<ul>
58-
{users.map((it) => (
59-
<li key={it.id}>{it.phone}</li>
60-
))}
61-
</ul>
62-
</>
63-
)}
19+
<RouterOutlet />
6420
</>
6521
);
6622
};

frontend/src/libs/packages/store/store.package.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ import { type IConfig } from '~/libs/packages/config/config.js';
1010
import { authApi } from '~/packages/auth/auth.js';
1111
import { userApi } from '~/packages/users/users.js';
1212
import { reducer as authReducer } from '~/slices/auth/auth.js';
13-
import { reducer as usersReducer } from '~/slices/users/users.js';
1413

1514
import { notification } from '../notification/notification.js';
1615
import { LocalStorage } from '../storage/storage.js';
1716

1817
type RootReducer = {
1918
auth: ReturnType<typeof authReducer>;
20-
users: ReturnType<typeof usersReducer>;
2119
};
2220

2321
type ExtraArguments = {
@@ -41,7 +39,6 @@ class Store {
4139
devTools: config.ENV.APP.ENVIRONMENT !== AppEnvironment.PRODUCTION,
4240
reducer: {
4341
auth: authReducer,
44-
users: usersReducer,
4542
},
4643
middleware: (getDefaultMiddleware) => {
4744
return getDefaultMiddleware({

frontend/src/slices/users/actions.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

frontend/src/slices/users/users.slice.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

frontend/src/slices/users/users.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)