Skip to content

Commit

Permalink
Merge pull request #611 from knowit/fix/606_side_for_ansatt_laster_ikke
Browse files Browse the repository at this point in the history
issue 606
  • Loading branch information
karo authored Oct 3, 2024
2 parents 775013d + 1030670 commit 8429fe9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
7 changes: 2 additions & 5 deletions apps/web/src/api/data/employee/employeeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ export const getEmployeeProfile = (email: string) =>
params: { email },
})

export const getEmployeeCompetence = (url: string, email: string) =>
export const getEmployeeCompetence = (email: string) =>
getAtApiV2<EmployeeCompetenceResponse>(`/employees/employeeCompetence`, {
params: { email },
})

export const getEmployeeMotivationAndCompetenceCharts = (
url: string,
email: string
) =>
export const getEmployeeMotivationAndCompetenceCharts = (email: string) =>
getAtApiV2<ChartData>('/employees/employeeMotivationAndCompetence', {
params: { email },
})
Expand Down
20 changes: 13 additions & 7 deletions apps/web/src/api/data/employee/employeeQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ export const useEmployeeTable = () =>
})

export const useEmployeeProfile = (email: string) =>
useSWR(['/employeeProfile', email], ([email]) => getEmployeeProfile(email), {
revalidateOnFocus: false,
})
useSWR(
{ url: '/employeeProfile', email: email },
(params) => getEmployeeProfile(params.email),
{
revalidateOnFocus: false,
}
)

export const useEmployeeCompetence = (email: string) =>
useSWR(
['/employeeCompetence', email],
([url, email]) => getEmployeeCompetence(url, email),
{ url: '/employeeCompetence', email: email },
(params) => getEmployeeCompetence(params.email),
{
revalidateOnFocus: false,
}
Expand All @@ -37,8 +41,10 @@ export const useEmployeeExperience = (email: string) =>
*/
export const useEmployeeMotivationAndCompetenceCharts = (email?: string) =>
useSWR(
email ? ['/employeeMotivationAndCompetenceCharts', email] : null,
([url, email]) => getEmployeeMotivationAndCompetenceCharts(url, email),
email
? { url: '/employeeMotivationAndCompetenceCharts', email: email }
: null,
(params) => getEmployeeMotivationAndCompetenceCharts(params.email),
{
revalidateOnFocus: false,
}
Expand Down

0 comments on commit 8429fe9

Please sign in to comment.