Skip to content

Commit

Permalink
Revert "fix: make casing consistent" (#192)
Browse files Browse the repository at this point in the history
Reverts #190

some commits were missed in that PR
  • Loading branch information
ssilve1989 authored Mar 31, 2024
1 parent 7815565 commit c84557a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/commands/lookup/lookup.dto.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { capitalCase } from 'change-case';
import { IsOptional, IsString } from 'class-validator';
import { ToCasing } from '../../common/decorators/to-casing.js';
import { ToLowercase } from '../../common/decorators/to-lowercase.js';
import { SignupDocument } from '../../firebase/models/signup.model.js';

export class LookupInteractionDto
implements Pick<SignupDocument, 'character' | 'world'>
{
@IsString()
@ToCasing(capitalCase)
@ToLowercase()
character: string;

@IsString()
@IsOptional()
@ToCasing(capitalCase)
@ToLowercase()
world: string;
}
2 changes: 1 addition & 1 deletion src/commands/signup/signup-interaction.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SignupInteractionDto
username: string;

@IsString()
@ToCasing(capitalCase)
@ToLowercase()
world: string;
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/decorators/to-casing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ type CaseTransformer = (value: string) => string;
* @returns
*/
export const ToCasing = (fn: CaseTransformer) =>
Transform(({ value }) => value && fn(value));
Transform(({ value }) => fn(value));

0 comments on commit c84557a

Please sign in to comment.