nodebb-plugin-simple-contact 2.1.7 → 2.2.0

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.
Files changed (2) hide show
  1. package/library.js +7 -0
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -147,6 +147,13 @@ async function handleContactSubmission(req, res) {
147
147
  return res.status(400).json({ error: 'נא למלא את כל שדות החובה.' });
148
148
  }
149
149
 
150
+ if (data.username) {
151
+ const exists = await user.getUidByUsername(data.username);
152
+ if (!exists) {
153
+ return res.status(400).json({ error: 'לא נמצא משתמש בשם זה. אנא כתבו שם נכון או השאירו ריק' });
154
+ }
155
+ }
156
+
150
157
  const contactId = Date.now();
151
158
  const key = 'contact-request:' + contactId;
152
159
  const senderUid = req.uid || 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-simple-contact",
3
- "version": "2.1.7",
3
+ "version": "2.2.0",
4
4
  "description": "תוסף טופס צור קשר עם התראות למנהלים וניהול פניות",
5
5
  "main": "library.js",
6
6
  "templates": "templates",