Skip to content

Commit 64edac4

Browse files
committed
fix: lint
1 parent b90b66f commit 64edac4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/apps/profiles/src/member-profile/work-expirence/WorkExpirence.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Dispatch, FC, SetStateAction, useCallback, useEffect, useMemo, useState } from 'react'
22
import { useSearchParams } from 'react-router-dom'
3+
import { SWRResponse } from 'swr'
34

4-
import { MemberTraitsAPI, useMemberTraits, UserProfile, UserTrait, UserTraitIds } from '~/libs/core'
5+
import { MemberTraitsAPI, useMemberTraits, UserProfile, UserSkill, UserTrait, UserTraitIds } from '~/libs/core'
56
import { useSkillsByIds } from '~/libs/shared/lib/services/standard-skills'
67

78
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
@@ -52,8 +53,7 @@ const WorkExpirence: FC<WorkExpirenceProps> = (props: WorkExpirenceProps) => {
5253
return Array.from(skillIdsSet)
5354
}, [workExpirence])
5455

55-
// Fetch skills using SWR hook
56-
const { data: fetchedSkills, error: skillsError } = useSkillsByIds(
56+
const { data: fetchedSkills, error: skillsError }: SWRResponse<UserSkill[], Error> = useSkillsByIds(
5757
allSkillIds.length > 0 ? allSkillIds : undefined,
5858
)
5959

src/libs/shared/lib/services/standard-skills/standard-skills.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useMemo } from 'react'
2-
import { SWRResponse } from 'swr'
3-
import useSWR from 'swr'
2+
import useSWR, { SWRResponse } from 'swr'
43

54
import { EnvironmentConfig } from '~/config'
65
import { UserSkill, xhrGetAsync, xhrPostAsync, xhrPutAsync } from '~/libs/core'
@@ -76,9 +75,11 @@ async function fetchSkillsByIdsFetcher(skillIds: string[]): Promise<UserSkill[]>
7675
export function useSkillsByIds(skillIds: string[] | undefined): SWRResponse<UserSkill[], Error> {
7776
const swrKey = useMemo(() => {
7877
if (!skillIds || skillIds.length === 0) {
79-
return null
78+
return undefined
8079
}
81-
return ['skills-by-ids', [...skillIds].sort().join(',')]
80+
81+
return ['skills-by-ids', [...skillIds].sort()
82+
.join(',')]
8283
}, [skillIds])
8384

8485
return useSWR<UserSkill[], Error>(

0 commit comments

Comments
 (0)