fix:convertDateToAPI

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-10-17 17:22:40 +07:00
parent 97aa731d2f
commit 1fc7882918
8 changed files with 42 additions and 13 deletions

View file

@ -133,6 +133,20 @@ interface Position2 {
positionExecutiveField: string; // ด้านทางการบริหาร
positionArea: string; // ด้าน/สาขา
positionIsSelected: string; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้นๆ หรือไม่?
orgShortname: string; // อักษรย่อตำแหน่ง
posMasterNoPrefix: string; // Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ)
posMasterNo: number | string; // เลขที่ตำแหน่ง เป็นตัวเลข
posMasterNoSuffix: string | null; // Suffix หลังเลขที่ตำแหน่ง เช่น ช.
fullNameCurrentHolder: string | null;
fullNameNextHolder: string | null;
positions: Position[]; // ตำแหน่ง
isSit: boolean;
profilePosition: string;
profilePostype: string;
profilePoslevel: string;
conditionReason: string;
isCondition: boolean;
isDirector: boolean;
}
interface PosMaster2 {
@ -162,7 +176,7 @@ interface PosMaster2 {
current_holderId?: string;
next_holderId?: string;
isSit?: boolean;
ancestorDNA: string;
ancestorDNA?: string;
}
interface HistoryPos {

View file

@ -9,6 +9,7 @@ import type {
DataActive,
SumPosition,
PosMaster,
PosMaster2,
} from "@/modules/02_organization/interface/response/organizational";
export const useOrganizational = defineStore("organizationalStore", () => {
@ -88,7 +89,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
* @returns
*/
function fetchPosMaster(data: PosMaster[]) {
const newPosMaster = data.map((e: PosMaster) => ({
const newPosMaster: PosMaster2[] = data.map((e: PosMaster) => ({
...e,
positionIsSelected:
typeOrganizational.value === "draft" && e.fullNameNextHolder !== null
@ -109,7 +110,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
isSit: e.isSit,
}));
return newPosMaster;
return newPosMaster || [];
}
/**