Skip to content

Commit

Permalink
made modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Feb 22, 2024
1 parent e9c9ac2 commit afb4506
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion apps/api/src/secret/dto/create.secret/create.secret.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsNumber, IsOptional, IsString } from 'class-validator'
import { IsNumber, IsOptional, IsString, Length } from 'class-validator'

export class CreateSecret {
@IsString()
Expand All @@ -9,6 +9,7 @@ export class CreateSecret {

@IsString()
@IsOptional()
@Length(0, 100)
note: string

@IsNumber()
Expand Down
10 changes: 6 additions & 4 deletions apps/api/src/secret/service/secret.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class SecretService {
},
data: {
name: dto.name,
note: dto.note ?? secret.note,
note: dto.note,
rotateAt: addHoursToDate(dto.rotateAfter),
lastUpdatedById: user.id,
versions: {
Expand All @@ -188,9 +188,11 @@ export class SecretService {
id: secretId
},
data: {
note: dto.note ?? secret.note,
name: dto.name ?? secret.name,
rotateAt: dto.rotateAfter ?? secret.rotateAt,
note: dto.note,
name: dto.name,
rotateAt: dto.rotateAfter
? addHoursToDate(dto.rotateAfter)
: undefined,
lastUpdatedById: user.id
}
})
Expand Down
3 changes: 2 additions & 1 deletion apps/api/src/variable/dto/create.variable/create.variable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsNumber, IsOptional, IsString } from 'class-validator'
import { IsNumber, IsOptional, IsString, Length } from 'class-validator'

export class CreateVariable {
@IsString()
Expand All @@ -9,6 +9,7 @@ export class CreateVariable {

@IsString()
@IsOptional()
@Length(0, 100)
note: string

@IsNumber()
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/variable/service/variable.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ export class VariableService {
id: variableId
},
data: {
note: dto.note ?? variable.note,
name: dto.name ?? variable.name,
note: dto.note,
name: dto.name,
lastUpdatedById: user.id
}
})
Expand Down

0 comments on commit afb4506

Please sign in to comment.