@opengis/admin 0.3.60 → 0.3.61
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/package.json
CHANGED
@@ -48,7 +48,6 @@ export default async function widgetSet(req, reply) {
|
|
48
48
|
file_status: 1,
|
49
49
|
uid: user?.uid || 1,
|
50
50
|
entity_id: objectid,
|
51
|
-
ismain: type === 'gallery' ? (Object.hasOwn(body, 'ismain') ? body.ismain : true) : undefined,
|
52
51
|
};
|
53
52
|
|
54
53
|
if (type === 'gallery' && !galleryExtList.includes(extName.toLowerCase())) {
|
@@ -60,7 +59,10 @@ export default async function widgetSet(req, reply) {
|
|
60
59
|
});
|
61
60
|
|
62
61
|
if (type === 'gallery') {
|
63
|
-
await pg.query(
|
62
|
+
await pg.query(`update crm.files set ismain=true
|
63
|
+
where entity_id=$1
|
64
|
+
and file_id=$2
|
65
|
+
and (select count(*) = 0 from crm.files where entity_id=$1 and ismain)`, [objectid, rows[0]?.file_id]);
|
64
66
|
}
|
65
67
|
|
66
68
|
return {
|