minor edits

This commit is contained in:
Zakharov_Rostislav 2024-06-03 21:46:58 +04:00
parent 451230933b
commit e9cb4dbe8f
7 changed files with 23 additions and 23 deletions

View File

@ -7,22 +7,10 @@
"role": "admin"
},
{
"name": "testUser",
"name": "user",
"password": "123",
"role": "user",
"id": 2
},
{
"name": "testUser2",
"password": "123",
"role": "user",
"id": 3
},
{
"name": "testUser3",
"password": "123",
"role": "user",
"id": 4
}
],
"types": [

View File

@ -1,8 +1,15 @@
import { Button, Table } from 'react-bootstrap';
import { useNavigate } from 'react-router-dom';
import AuthorizationForm from '../components/users/authorization/form/AuthorizationForm.jsx';
const UserFavorities = () => {
const navigate = useNavigate();
if (!parseInt(localStorage.getItem('userId'), 10)) {
return (
<AuthorizationForm/>
);
}
return (
<>
<h1 className='mt-2 text-md-start text-center'>

View File

@ -1,8 +1,14 @@
import { Button, Table } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import AuthorizationForm from '../components/users/authorization/form/AuthorizationForm.jsx';
const UserHistory = () => {
// const navigate = useNavigate();
if (!parseInt(localStorage.getItem('userId'), 10)) {
return (
<AuthorizationForm/>
);
}
return (
<>
<h1 className='mt-2 text-md-start text-center'>

View File

@ -2,8 +2,7 @@ import AuthorizationForm from '../components/users/authorization/form/Authorizat
import UserPageInfo from '../components/users/userPage/UserPageInfo.jsx';
const UserPage = () => {
const id = parseInt(localStorage.getItem('userId'), 10);
if (!id) {
if (!parseInt(localStorage.getItem('userId'), 10)) {
return (
<AuthorizationForm/>
);

View File

@ -36,7 +36,7 @@ public class BookController {
private BookDto toBookDto (BookEntity entity) {
BookDto bookDto = modelMapper.map(entity, BookDto.class);
bookDto.setAuthorId(entity.getAuthorsBooks().stream().map(x -> x.getAuthor().getId()).toList());
bookDto.setAuthorIds(entity.getAuthorsBooks().stream().map(x -> x.getAuthor().getId()).toList());
return bookDto;
}

View File

@ -17,7 +17,7 @@ public class BookDto {
@Min(1)
private Long typeId;
@NotNull
private List<Long> authorsId;
private List<Long> authorIds;
public Long getId() {
return id;
@ -43,11 +43,11 @@ public class BookDto {
this.typeId = typeId;
}
public List<Long> getAuthorsId() {
return authorsId;
public List<Long> getAuthorIds() {
return authorIds;
}
public void setAuthorId(List<Long> authorsId) {
this.authorsId = authorsId;
public void setAuthorIds(List<Long> authorIds) {
this.authorIds = authorIds;
}
}

View File

@ -30,7 +30,7 @@ public class UserBookController {
private BookDto toBookDto (BookEntity entity) {
BookDto bookDto = modelMapper.map(entity, BookDto.class);
bookDto.setAuthorId(entity.getAuthorsBooks().stream().map(x -> x.getAuthor().getId()).toList());
bookDto.setAuthorIds(entity.getAuthorsBooks().stream().map(x -> x.getAuthor().getId()).toList());
return bookDto;
}