Linting
This commit is contained in:
@@ -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 { logger } from 'src/lib/logger'
|
||||||
import { db } from 'src/lib/db'
|
import { db } from 'src/lib/db'
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ import { db } from 'src/lib/db'
|
|||||||
* @param { Context } context - contains information about the invocation,
|
* @param { Context } context - contains information about the invocation,
|
||||||
* function, and execution environment.
|
* 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')
|
logger.info('Invoked checkUserName function')
|
||||||
const userName = event.queryStringParameters.username
|
const userName = event.queryStringParameters.username
|
||||||
let isUserNameAvailable = false
|
let isUserNameAvailable = false
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export const generateUniqueString = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const generateUniqueStringWithoutSeed = async (
|
export const generateUniqueStringWithoutSeed = async (
|
||||||
isUniqueCallback: (seed: string) => Promise<any>,
|
isUniqueCallback: (seed: string) => Promise<boolean>,
|
||||||
count = 0
|
count = 0
|
||||||
) => {
|
) => {
|
||||||
const seed = humanId({
|
const seed = humanId({
|
||||||
|
|||||||
@@ -47,15 +47,17 @@ export const projectByUserAndTitle = async ({ userName, projectTitle }) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const isUniqueProjectTitle = (userId: string) => async (seed: string) =>
|
const isUniqueProjectTitle =
|
||||||
db.project.findUnique({
|
(userId: string) =>
|
||||||
where: {
|
async (seed: string): Promise<boolean> =>
|
||||||
title_userId: {
|
!!(await db.project.findUnique({
|
||||||
title: seed,
|
where: {
|
||||||
userId,
|
title_userId: {
|
||||||
|
title: seed,
|
||||||
|
userId,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
}))
|
||||||
})
|
|
||||||
|
|
||||||
interface CreateProjectArgs {
|
interface CreateProjectArgs {
|
||||||
input: Prisma.ProjectCreateArgs['data']
|
input: Prisma.ProjectCreateArgs['data']
|
||||||
|
|||||||
Reference in New Issue
Block a user