fix: trim whitespace from network sync URL and API key; clarify source URL format in UI

Copy-paste often adds trailing whitespace that breaks the API key comparison.
Updated placeholder and description to show the correct URL format (no port number).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Summit Dental Care
2026-06-22 23:14:00 -04:00
parent a2621eba6c
commit 8e18e96db4
2 changed files with 10 additions and 5 deletions

View File

@@ -574,7 +574,12 @@ router.get("/network-sync-config", (req, res) => {
router.put("/network-sync-config", (req: Request, res: Response): any => {
if (!req.user?.id) return res.status(401).json({ error: "Unauthorized" });
const { enabled, syncHour, sourceUrl, apiKey } = req.body;
const updated = writeSyncConfig({ enabled, syncHour, sourceUrl, apiKey });
const updated = writeSyncConfig({
enabled,
syncHour,
sourceUrl: typeof sourceUrl === "string" ? sourceUrl.trim() : sourceUrl,
apiKey: typeof apiKey === "string" ? apiKey.trim() : apiKey,
});
res.json(updated);
});