generated from kir-dev/next-nest-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 9. Implemented User Controller Service * 18. Extended the UserEntity with favouriteDrinks * Delete line 4 in users.controller.ts * Changed the Requested Corrections * Requested Corrections * 23. Add Gender and Weight to User * Requested Corrections (Not Working) * Requested Corrections (But Now It Actualy Works)
- Loading branch information
Showing
10 changed files
with
1,173 additions
and
962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
apps/backend/prisma/migrations/20240706181116_added_gender_and_weight/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- CreateEnum | ||
CREATE TYPE "Gender" AS ENUM ('Male', 'Female'); | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "gender" "Gender", | ||
ADD COLUMN "weight" DOUBLE PRECISION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Gender } from '@prisma/client'; | ||
import { IsEnum, IsOptional, Min } from 'class-validator'; | ||
import { IsFloat } from 'src/util/is-float.validator'; | ||
|
||
export class UserGenderWeight { | ||
/** | ||
* Gender | ||
* @example Male | ||
*/ | ||
@IsEnum(Gender) | ||
@IsOptional() | ||
gender?: Gender; | ||
|
||
/** | ||
* Weight | ||
* @example 75.2 | ||
*/ | ||
@IsFloat() | ||
@Min(0) | ||
@IsOptional() | ||
weight?: number; | ||
} |
2 changes: 1 addition & 1 deletion
2
.../users/entities/UserWithFavoriteDrinks.ts → ...sers/dto/user-with-favorite-drinks.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { OmitType } from '@nestjs/swagger'; | ||
|
||
import { User } from '../entities/user.entity'; | ||
|
||
export class UserWithoutWeight extends OmitType(User, ['weight']) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.