Skip to content

Commit

Permalink
Merge pull request #37 from ThomasOliver545/2022/update-deps
Browse files Browse the repository at this point in the history
2022/update deps
  • Loading branch information
TommiCodes authored Dec 28, 2021
2 parents 8d7e79d + 0f6af7c commit 8f49537
Show file tree
Hide file tree
Showing 9 changed files with 19,708 additions and 21,108 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ If you are coming from a specific video, you can have a look at the commits, the
Hint: Upon 2022 the new features are not prefixed like this anymore (cause there isn't a video for every step anymore).

# Updated 2022 (Project now dockerized)
This Project is now dockerized.
1. Angular is updated to v13 and NestJS is updated to v8.
2. This Project is now dockerized.
We have one Dockerfile for the api (NestJS) and one for the frontend(Angular).
On the top file level there is a `docker-compose.yml` file that you can start, there is also the database and everything configured. So you don't need to do anything else than run `docker-compose up`.

(A Video covering these updates will be released within January 2022).

# Instructions to run the Project

## With Docker
Expand Down
12,649 changes: 0 additions & 12,649 deletions api/package-lock.json

This file was deleted.

64 changes: 32 additions & 32 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,48 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^7.0.0",
"@nestjs/config": "^0.4.0",
"@nestjs/core": "^7.0.0",
"@nestjs/jwt": "^7.0.0",
"@nestjs/passport": "^7.0.0",
"@nestjs/platform-express": "^7.2.0",
"@nestjs/common": "^8.2.4",
"@nestjs/config": "^1.1.5",
"@nestjs/core": "^8.2.4",
"@nestjs/jwt": "^8.0.0",
"@nestjs/passport": "^8.0.1",
"@nestjs/platform-express": "^8.2.4",
"@nestjs/serve-static": "^2.1.3",
"@nestjs/typeorm": "^7.0.0",
"bcrypt": "^4.0.1",
"nestjs-typeorm-paginate": "^2.0.3",
"@nestjs/typeorm": "^8.0.2",
"bcrypt": "^5.0.1",
"nestjs-typeorm-paginate": "^3.1.3",
"passport": "^0.4.1",
"passport-jwt": "^4.0.0",
"pg": "^8.0.3",
"pg": "^8.6.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.5.4",
"rxjs": "^7.2.0",
"slugify": "^1.4.5",
"typeorm": "^0.2.25",
"typeorm": "^0.2.41",
"uuid": "^8.2.0"
},
"devDependencies": {
"@nestjs/cli": "^7.0.0",
"@nestjs/schematics": "^7.0.0",
"@nestjs/testing": "^7.0.0",
"@types/express": "^4.17.3",
"@types/jest": "25.1.4",
"@types/node": "^13.9.1",
"@nestjs/cli": "^8.1.6",
"@nestjs/schematics": "^8.0.5",
"@nestjs/testing": "^8.2.4",
"@types/express": "^4.17.13",
"@types/jest": "27.0.2",
"@types/node": "^16.0.0",
"@types/passport-jwt": "^3.0.3",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"jest": "^25.1.0",
"prettier": "^1.19.1",
"supertest": "^4.0.2",
"ts-jest": "25.2.1",
"ts-loader": "^6.2.1",
"ts-node": "^8.6.2",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.7.4"
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.2.5",
"prettier": "^2.3.2",
"supertest": "^6.1.3",
"ts-jest": "^27.0.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "^3.10.1",
"typescript": "^4.3.5"
},
"jest": {
"moduleFileExtensions": [
Expand Down
14 changes: 7 additions & 7 deletions api/src/user/service/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export class UserService {

paginateFilterByUsername(options: IPaginationOptions, user: User): Observable<Pagination<User>>{
return from(this.userRepository.findAndCount({
skip: options.page * options.limit || 0,
take: options.limit || 10,
skip: Number(options.page) * Number(options.limit) || 0,
take: Number(options.limit) || 10,
order: {id: "ASC"},
select: ['id', 'name', 'username', 'email', 'role'],
where: [
Expand All @@ -80,15 +80,15 @@ export class UserService {
links: {
first: options.route + `?limit=${options.limit}`,
previous: options.route + ``,
next: options.route + `?limit=${options.limit}&page=${options.page +1}`,
last: options.route + `?limit=${options.limit}&page=${Math.ceil(totalUsers / options.limit)}`
next: options.route + `?limit=${options.limit}&page=${Number(options.page) + 1}`,
last: options.route + `?limit=${options.limit}&page=${Math.ceil(totalUsers / Number(options.limit))}`
},
meta: {
currentPage: options.page,
currentPage: Number(options.page),
itemCount: users.length,
itemsPerPage: options.limit,
itemsPerPage: Number(options.limit),
totalItems: totalUsers,
totalPages: Math.ceil(totalUsers / options.limit)
totalPages: Math.ceil(totalUsers / Number(options.limit))
}
};
return usersPageable;
Expand Down
1 change: 1 addition & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ speed-measure-plugin*.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /thomas/frontend/src/app
COPY package*.json ./

RUN npm install
RUN npm install -g @angular/cli@12.0.0
RUN npm install -g @angular/cli@13.0.0

COPY . .

Expand Down
Loading

0 comments on commit 8f49537

Please sign in to comment.