weareinreach / InReach

async function should have await expression JS-0116
Bug risk
Minor
a day agoa year old
Found async function without any await expressions
146		</>
147	)
148}
149export const getStaticPaths: GetStaticPaths = async () => {150	return {151		paths: [],152		fallback: 'blocking',153	}154}155export const getStaticProps = async ({
156	params,
157	locale,
Found async function without any await expressions
 5
 6import { type TGetParentNameSchema } from './query.getParentName.schema'
 7
 8const getParentName = async ({ input }: TRPCHandlerParams<TGetParentNameSchema>) => { 9	const { slug, orgLocationId } = input1011	switch (true) {12		case Boolean(slug): {13			return prisma.organization.findUniqueOrThrow({14				where: { slug },15				select: { name: true },16			})17		}18		case Boolean(orgLocationId): {19			return prisma.orgLocation.findUniqueOrThrow({20				where: { id: orgLocationId },21				select: { name: true },22			})23		}24		default: {25			throw new TRPCError({ code: 'BAD_REQUEST' })26		}27	}28}29export default getParentName
Found async function without any await expressions
 3
 4import { type TGetNameFromSlugSchema } from './query.getNameFromSlug.schema'
 5
 6const getNameFromSlug = async ({ input }: TRPCHandlerParams<TGetNameFromSlugSchema>) => { 7	const result = prisma.organization.findUniqueOrThrow({ 8		where: { 9			slug: input,10		},11		select: {12			name: true,13		},14	})15	return result16}17export default getNameFromSlug
Found async function without any await expressions
 3
 4import { type TGetAllForRecordSchema } from './query.getAllForRecord.schema'
 5
 6const getAllForRecord = async ({ input }: TRPCHandlerParams<TGetAllForRecordSchema, 'protected'>) => { 7	const results = prisma.internalNote.findMany({ where: input }) 8	return results 9}10export default getAllForRecord
Found async function without any await expressions
 4
 5import { type TServiceModalSchema } from './query.serviceModal.schema'
 6
 7const serviceModal = async ({ ctx, input }: TRPCHandlerParams<TServiceModalSchema>) => { 8	try { 9		return null10	} catch (error) {11		handleError(error)12	}13}14export default serviceModal