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 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
- const sampleItems = list.slice(0, 10).map(it => ({
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-equipment-calendar",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Equipment reservation calendar for NodeBB (FullCalendar, approvals, HelloAsso payments)",
5
5
  "main": "library.js",
6
6
  "scripts": {
package/plugin.json CHANGED
@@ -25,6 +25,6 @@
25
25
  "scripts": [
26
26
  "public/js/client.js"
27
27
  ],
28
- "version": "0.4.8",
28
+ "version": "0.4.9",
29
29
  "minver": "4.7.1"
30
30
  }