zet-lib 1.2.53 → 1.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/zRoute.js +4 -4
- package/package.json +1 -1
package/lib/zRoute.js
CHANGED
|
@@ -3525,8 +3525,8 @@ zRoute.import = async (req, res, MYMODEL) => {
|
|
|
3525
3525
|
//console.log(JSON.stringify(result))
|
|
3526
3526
|
for (let prop in keys) {
|
|
3527
3527
|
//console.log(prop)
|
|
3528
|
-
let value = result[prop] ? result[prop] : null
|
|
3529
|
-
if (value) {
|
|
3528
|
+
let value = result[prop] == 0 ? 0 : result[prop] ? result[prop] : null
|
|
3529
|
+
if (value != null) {
|
|
3530
3530
|
if (aliasRelations.includes(keys[prop])) {
|
|
3531
3531
|
let result_alias = await connection.result({
|
|
3532
3532
|
select: `id, ${MYMODEL.widgets[keys[prop]].import_field} `,
|
|
@@ -3581,15 +3581,15 @@ zRoute.import = async (req, res, MYMODEL) => {
|
|
|
3581
3581
|
if (mydatas.lock == 1) {
|
|
3582
3582
|
hd += `<td class='text text-success'>Data is locked</td>`
|
|
3583
3583
|
} else {
|
|
3584
|
-
|
|
3584
|
+
await connection.update({
|
|
3585
3585
|
table: MYMODEL.table,
|
|
3586
3586
|
data: data,
|
|
3587
3587
|
where: {
|
|
3588
3588
|
id: data.id,
|
|
3589
3589
|
},
|
|
3590
3590
|
})
|
|
3591
|
+
hd += `<td class='text text-success'>${LANGUAGE['success']}</td>`
|
|
3591
3592
|
}
|
|
3592
|
-
hd += `<td class='text text-success'>${LANGUAGE['success']}</td>`
|
|
3593
3593
|
}
|
|
3594
3594
|
} catch (err) {
|
|
3595
3595
|
hd += `<td class='text text-danger'>${err + ''}</td>`
|