Skip to content

Commit

Permalink
chore: concising
Browse files Browse the repository at this point in the history
  • Loading branch information
thorkellmani committed Aug 14, 2024
1 parent 8b94bfa commit 781a01e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export class GenericLicenseError {
provider?: GenericLicenseProvider

@Field(() => Int, { nullable: true })
errorCode?: number
code?: number

@Field({ nullable: true })
errorMessage?: string
message?: string

@Field({ nullable: true })
extraData?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ export class LicenseService {
status: GenericUserLicenseFetchStatus.Error,
updated: new Date().getTime().toString(),
},
errorCode: licensesFetchResponse.error.code,
errorMessage: licensesFetchResponse.error.message,
code: licensesFetchResponse.error.code,
message: licensesFetchResponse.error.message,
extraData: licensesFetchResponse.error.data,
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ query GenericLicenseCollection(
status
updated
}
errorCode
errorMessage
code
message
extraData
}
}
Expand Down
14 changes: 3 additions & 11 deletions libs/service-portal/licenses/src/utils/capitalize.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
export const capitalizeEveryWord = (s: string) => {
if (typeof s !== 'string') return ''
import capitalize from 'lodash/capitalize'

const arr = s.split(' ')

const capitalized = arr.map(
(item) => item.charAt(0).toUpperCase() + item.slice(1).toLowerCase(),
)

const word = capitalized.join(' ')
return word
}
export const capitalizeEveryWord = (str: string): string =>
str.split(' ').map(capitalize).join(' ')

0 comments on commit 781a01e

Please sign in to comment.