Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Irev-Dev committed Oct 13, 2021
1 parent 68fa104 commit 3df903f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/api/src/functions/check-user-name/check-user-name.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { APIGatewayEvent, Context } from 'aws-lambda'
import type { APIGatewayEvent /*, Context*/ } from 'aws-lambda'
import { logger } from 'src/lib/logger'
import { db } from 'src/lib/db'

Expand All @@ -18,7 +18,7 @@ import { db } from 'src/lib/db'
* @param { Context } context - contains information about the invocation,
* function, and execution environment.
*/
export const handler = async (event: APIGatewayEvent, context: Context) => {
export const handler = async (event: APIGatewayEvent /*context: Context*/) => {
logger.info('Invoked checkUserName function')
const userName = event.queryStringParameters.username
let isUserNameAvailable = false
Expand Down
2 changes: 1 addition & 1 deletion app/api/src/services/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const generateUniqueString = async (
}

export const generateUniqueStringWithoutSeed = async (
isUniqueCallback: (seed: string) => Promise<any>,
isUniqueCallback: (seed: string) => Promise<boolean>,
count = 0
) => {
const seed = humanId({
Expand Down
18 changes: 10 additions & 8 deletions app/api/src/services/projects/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ export const projectByUserAndTitle = async ({ userName, projectTitle }) => {
},
})
}
const isUniqueProjectTitle = (userId: string) => async (seed: string) =>
db.project.findUnique({
where: {
title_userId: {
title: seed,
userId,
const isUniqueProjectTitle =
(userId: string) =>
async (seed: string): Promise<boolean> =>
!!(await db.project.findUnique({
where: {
title_userId: {
title: seed,
userId,
},
},
},
})
}))

interface CreateProjectArgs {
input: Prisma.ProjectCreateArgs['data']
Expand Down

0 comments on commit 3df903f

Please sign in to comment.