ปรับหน้ารายละเอียดของผู้สอบผ่าน เเก้เป็นส่ง name แทน id
This commit is contained in:
parent
507c94b955
commit
15738c7668
6 changed files with 33 additions and 27 deletions
|
|
@ -247,7 +247,7 @@ const selectSubDistrict = (e: string | null, name: string) => {
|
|||
const fetchProvince = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.province)
|
||||
.get(config.API.orgProvince)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
let option: optionData[] = [];
|
||||
|
|
@ -326,9 +326,9 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
|||
if (id != null && id != "") {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listDistrict(id))
|
||||
.get(config.API.orgProvince+`/${id}`)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
const data = res.data.result.districts;
|
||||
let option: optionData[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
|
|
@ -372,9 +372,9 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
|
|||
if (id != null && id != "") {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listSubDistrict(id))
|
||||
.get(config.API.orgDistrict+`/${id}`)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
const data = res.data.result.subDistricts;
|
||||
let option: zipCodeOption[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({
|
||||
|
|
|
|||
|
|
@ -81,12 +81,12 @@ const refreshData = async () => {
|
|||
const fetchPrefix = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.prefix)
|
||||
.get(config.API.profileNewMetaMain)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
data.prefixs.map((r: any) => {
|
||||
option.push({ id: r.name.toString(), name: r.name.toString() });
|
||||
});
|
||||
Ops.value.prefixOps = option;
|
||||
OpsFilter.value.prefixOps = option;
|
||||
|
|
|
|||
|
|
@ -112,53 +112,59 @@ const onCancel = async () => {
|
|||
const fetchPerson = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.person)
|
||||
.get(config.API.profileNewMetaMain)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
//กรุ๊ปเลือด
|
||||
let optionbloodGroups: optionData[] = [];
|
||||
data.bloodGroups.map((r: any) => {
|
||||
optionbloodGroups.push({
|
||||
id: r.id ?? "",
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.bloodOps = optionbloodGroups;
|
||||
OpsFilter.value.bloodOps = optionbloodGroups;
|
||||
|
||||
//เพศ
|
||||
let optiongenders: optionData[] = [];
|
||||
data.genders.map((r: any) => {
|
||||
optiongenders.push({
|
||||
id: r.id ?? "",
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.genderOps = optiongenders;
|
||||
OpsFilter.value.genderOps = optiongenders;
|
||||
|
||||
//คำนำหน้าชื่อ
|
||||
let optionprefixs: optionData[] = [];
|
||||
data.prefixs.map((r: any) => {
|
||||
optionprefixs.push({
|
||||
id: r.id ?? "",
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.prefixOps = optionprefixs;
|
||||
OpsFilter.value.prefixOps = optionprefixs;
|
||||
|
||||
//สถานภาพ
|
||||
let optionrelationships: optionData[] = [];
|
||||
data.relationships.map((r: any) => {
|
||||
optionrelationships.push({
|
||||
id: r.id ?? "",
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.statusOps = optionrelationships;
|
||||
OpsFilter.value.statusOps = optionrelationships;
|
||||
|
||||
//ศาสนา
|
||||
let optionreligions: optionData[] = [];
|
||||
data.religions.map((r: any) => {
|
||||
optionreligions.push({
|
||||
id: r.id ?? "",
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue