summaryrefslogtreecommitdiff
path: root/lib/users
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-08-14 13:15:21 +0000
committerjoonhoekim <26rote@gmail.com>2025-08-14 13:15:21 +0000
commit49d236df3bd2bd976ebc424644f34f5affa1074f (patch)
tree7b0f60c399e724847894061fae74876aa1bf5c7e /lib/users
parent969c25b56f6d29d7ffa4bc2ce04c5fb4e5846b34 (diff)
(김준회) 결재 테스트 모듈 수정, 환경병수 eVCP 운영 대응, SGIPS JWT TOKEN 수정, SHI-API 기반 유저 관리 추가, 유저목록 테이블 변경
Diffstat (limited to 'lib/users')
-rw-r--r--lib/users/auth/verifyCredentails.ts2
-rw-r--r--lib/users/table/users-table-columns.tsx25
2 files changed, 22 insertions, 5 deletions
diff --git a/lib/users/auth/verifyCredentails.ts b/lib/users/auth/verifyCredentails.ts
index a5dbab41..5cb9c24f 100644
--- a/lib/users/auth/verifyCredentails.ts
+++ b/lib/users/auth/verifyCredentails.ts
@@ -510,7 +510,7 @@ export async function verifySGipsCredentials(
method: 'GET',
headers: {
'Content-Type': 'application/json',
- 'Authorization': `Bearer ${process.env.S_GIPS_TOKEN}`,
+ 'Authorization': `Bearer ${process.env.SHI_API_JWT_TOKEN}`,
},
});
diff --git a/lib/users/table/users-table-columns.tsx b/lib/users/table/users-table-columns.tsx
index 217fefcf..d4c5c78a 100644
--- a/lib/users/table/users-table-columns.tsx
+++ b/lib/users/table/users-table-columns.tsx
@@ -6,7 +6,6 @@ import { type ColumnDef } from "@tanstack/react-table"
import { Ellipsis } from "lucide-react"
import { userRoles, type UserView } from "@/db/schema/users"
-import { formatDate } from "@/lib/utils"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Checkbox } from "@/components/ui/checkbox"
@@ -96,10 +95,28 @@ export function getColumns({ setRowAction }: GetColumnsProps): ColumnDef<UserVie
type: cfg.type,
},
cell: ({ row, cell }) => {
+ // 날짜 컬럼: YYYY-MM-DD HH:mm
+ if (cfg.id === "created_at" || cfg.id === "updated_at" || cfg.id === "deactivated_at") {
+ const v = cell.getValue() as Date | string | null | undefined
+ if (!v) return ""
+ const d = new Date(v as any)
+ const y = d.getFullYear()
+ const m = String(d.getMonth() + 1).padStart(2, "0")
+ const day = String(d.getDate()).padStart(2, "0")
+ const hh = String(d.getHours()).padStart(2, "0")
+ const mm = String(d.getMinutes()).padStart(2, "0")
+ return `${y}-${m}-${day} ${hh}:${mm}`
+ }
- if (cfg.id === "created_at") {
- const dateVal = cell.getValue() as Date
- return formatDate(dateVal, "KR")
+ // 불리언 컬럼: Y/N
+ if (
+ cfg.id === "is_locked" ||
+ cfg.id === "is_absent" ||
+ cfg.id === "is_deleted_on_non_sap" ||
+ cfg.id === "is_regular_employee"
+ ) {
+ const v = row.getValue(cfg.id) as boolean | null | undefined
+ return v === true ? "Y" : v === false ? "N" : ""
}
if (cfg.id === "roles") {