From 3f7e4f5dc89127eeab326fbc4b31a545f515a376 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 20 十月 2025 15:24:15 +0800
Subject: [PATCH] fix: bug
---
packages/hooks/user.ts | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/packages/hooks/user.ts b/packages/hooks/user.ts
index 190eaf1..1c703a5 100644
--- a/packages/hooks/user.ts
+++ b/packages/hooks/user.ts
@@ -1,5 +1,6 @@
import { MaybeRef, computed, unref } from 'vue';
import * as userResumeServices from '@12333/services/apiV2/userResume';
+import * as enterpriseEmployeeServices from '@12333//services/apiV2/enterpriseEmployee';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
type UseUserResumeOptions = {
@@ -52,3 +53,32 @@
updateUserResume,
};
}
+
+type UseGetEnterpriseEmployeeOptions = {
+ id?: MaybeRef<string>;
+};
+
+export function useGetEnterpriseEmployee(options: UseGetEnterpriseEmployeeOptions = {}) {
+ const { id } = options;
+
+ const { data, refetch, isLoading, isError } = useQuery({
+ queryKey: ['enterpriseEmployeeServices/getEnterpriseEmployee', id],
+ queryFn: async () => {
+ return await enterpriseEmployeeServices.getEnterpriseEmployee(
+ { id: unref(id) },
+ {
+ showLoading: false,
+ }
+ );
+ },
+ placeholderData: () => ({} as API.GetEnterpriseEmployeeQueryResult),
+ enabled: computed(() => !!unref(id)),
+ });
+
+ return {
+ enterpriseEmployeeInfo: data,
+ refetch,
+ isLoading,
+ isError,
+ };
+}
--
Gitblit v1.9.1