fix mapping profile

This commit is contained in:
mahdahar 2024-12-06 16:10:12 +07:00
parent 968938a100
commit f9d7317dea
2 changed files with 9 additions and 2 deletions

View File

@ -117,7 +117,7 @@ class API_DictMappings extends ResourceController {
WHEN NOT MATCHED BY TARGET THEN
INSERT (MAPID, LISCODE)
VALUES (s.MAPID, s.LISCODE)
WHEN NOT MATCHED BY SOURCE THEN
WHEN NOT MATCHED BY SOURCE and t.MAPID='$update' THEN
DELETE;";
if( $db->query($sql) ) {

View File

@ -183,6 +183,13 @@ function editProfile(mapid) {
$("#updateProfile").val(mapid);
$("#hiscodeProfile").val(data.HISCODE);
$("#descsProfile").val(data.DESCS);
// empty mliscode
for (let i = 1; i <= 22; i++) {
let id = `.mliscode${i}`;
let element = $(id);
element.val('');
}
// populate mliscode
for (let i = 0; i < data.mliscodes.length; i++) {
const fieldId = `mliscode${i + 1}`;
$(`.${fieldId}`).val(data.mliscodes[i].LISCODE);