You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ProcessMaker/Http/Controllers/Api/SettingController.php
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
namespaceProcessMaker\Http\Controllers\Api;
4
4
5
5
useDB;
6
+
useIlluminate\Database\QueryException;
6
7
useIlluminate\Http\Request;
7
8
useIlluminate\Support\Facades\Auth;
8
9
useIlluminate\Support\Facades\Storage;
@@ -265,6 +266,28 @@ public function update(Setting $setting, Request $request)
265
266
returnresponse([], 204);
266
267
}
267
268
269
+
publicfunctionstore(Request$request)
270
+
{
271
+
$setting = newSetting();
272
+
273
+
try {
274
+
$setting->fill($request->json()->all());
275
+
$setting->saveOrFail();
276
+
277
+
returnresponse([], 201);
278
+
} catch (QueryException$e) {
279
+
// Check for duplicate entry error code
280
+
if ($e->errorInfo[1] == 1062) {
281
+
returnresponse()->json([
282
+
'message' => 'The "Site Name" you\'re trying to add already exists. Please select a different name or review the existing entries to avoid duplication.',
283
+
], 409);
284
+
}
285
+
286
+
// Handle other query exceptions
287
+
returnresponse()->json(['message' => 'An error occurred while saving the setting.'], 500);
Copy file name to clipboardExpand all lines: resources/lang/en.json
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -444,6 +444,7 @@
444
444
"Configure Script": "Configure Script",
445
445
"Configure Template": "Configure Template",
446
446
"Configure the authenticator app": "Configure the authenticator app",
447
+
"Configure URL Parents for Embedding": "Configure URL Parents for Embedding",
447
448
"Configure": "Configure",
448
449
"Confirm and Save": "Confirm and Save",
449
450
"Confirm New Password": "Confirm New Password",
@@ -1549,6 +1550,7 @@
1549
1550
"Please choose the tasks in your inbox that this new rule should apply to. <b>Use the column filters</b> to achieve this.": "Please choose the tasks in your inbox that this new rule should apply to. <b>Use the column filters</b> to achieve this.",
1550
1551
"Please contact your administrator to get started.": "Please contact your administrator to get started.",
1551
1552
"Please enter Tab Name": "Please enter Tab Name",
1553
+
"Please provide a valid URL (e.g., https://example.com ) to specify the allowed origin(s) permitted to embed ProcessMaker.": "Please provide a valid URL (e.g., https://example.com ) to specify the allowed origin(s) permitted to embed ProcessMaker.",
1552
1554
"Please log in to continue your work on this page.": "Please log in to continue your work on this page.",
1553
1555
"Please select a Saved Search": "Please select a Saved Search",
1554
1556
"Please take a look at it in the 'Rules' section located within your Inbox.": "Please take a look at it in the 'Rules' section located within your Inbox.",
->assertJson(['message' => 'The "Site Name" you\'re trying to add already exists. Please select a different name or review the existing entries to avoid duplication.']);
0 commit comments