nodebb-plugin-equipment-calendar 0.8.2 → 0.8.3
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/library.js +5 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
package/library.js
CHANGED
|
@@ -794,6 +794,8 @@ async function handleHelloAssoTest(req, res) {
|
|
|
794
794
|
if (!isAdmin) return helpers.notAllowed(req, res);
|
|
795
795
|
|
|
796
796
|
const settings = await getSettings();
|
|
797
|
+
let sampleItems = [];
|
|
798
|
+
let hasSampleItems = false;
|
|
797
799
|
let ok = false;
|
|
798
800
|
let message = '';
|
|
799
801
|
let count = 0;
|
|
@@ -807,11 +809,12 @@ async function handleHelloAssoTest(req, res) {
|
|
|
807
809
|
const items = await fetchHelloAssoItems(settings);
|
|
808
810
|
const list = Array.isArray(items) ? items : (Array.isArray(items.data) ? items.data : []);
|
|
809
811
|
count = list.length;
|
|
810
|
-
|
|
812
|
+
sampleItems = list.slice(0, 10).map(it => ({
|
|
811
813
|
id: String(it.id || it.itemId || it.reference || it.slug || it.name || '').trim(),
|
|
812
814
|
name: String(it.name || it.label || it.title || '').trim(),
|
|
813
815
|
rawName: String(it.name || it.label || it.title || it.id || '').trim(),
|
|
814
816
|
}));
|
|
817
|
+
hasSampleItems = sampleItems && sampleItems.length > 0;
|
|
815
818
|
ok = true;
|
|
816
819
|
message = `OK: token valide. Items récupérés: ${count}.`;
|
|
817
820
|
} catch (e) {
|
|
@@ -826,6 +829,7 @@ async function handleHelloAssoTest(req, res) {
|
|
|
826
829
|
count,
|
|
827
830
|
settings,
|
|
828
831
|
sampleItems,
|
|
832
|
+
hasSampleItems,
|
|
829
833
|
hasSampleItems: sampleItems && sampleItems.length > 0,
|
|
830
834
|
});
|
|
831
835
|
}
|
package/package.json
CHANGED