generated from Dicken/dickendock
round14: Uebernehmen-Bug und Suggestion-Debounce fixen, Read-Later-Verwaltungsseite, konfigurierbares Read-Later-Limit
This commit is contained in:
@@ -119,10 +119,8 @@ function EditForm({ service, onDone }: { service: Service; onDone: () => void })
|
||||
const previewUrl = `${https ? "https" : "http"}://${hostname || service.hostname}:${portNumber}`;
|
||||
|
||||
const mutation = useMutation({
|
||||
mutationFn: () =>
|
||||
patchService(service.id, {
|
||||
displayName: displayName.trim(),
|
||||
category: category.trim() || null,
|
||||
mutationFn: () => {
|
||||
const patch: Record<string, unknown> = {
|
||||
alias: alias
|
||||
.split(",")
|
||||
.map((a) => a.trim())
|
||||
@@ -132,7 +130,18 @@ function EditForm({ service, onDone }: { service: Service; onDone: () => void })
|
||||
port: portNumber,
|
||||
https,
|
||||
url: previewUrl,
|
||||
}),
|
||||
};
|
||||
// displayName/category nur mitschicken, wenn sich der Wert tatsächlich
|
||||
// geändert hat - sonst würde jedes Speichern (z. B. nur um den Port zu
|
||||
// korrigieren) die *EditedManually-Flag fälschlich setzen, obwohl der
|
||||
// Nutzer diese beiden Felder gar nicht angefasst hat (siehe
|
||||
// upsertServiceFromScan/updateService-Doku in services.ts).
|
||||
const trimmedName = displayName.trim();
|
||||
if (trimmedName !== service.displayName) patch.displayName = trimmedName;
|
||||
const trimmedCategory = category.trim() || null;
|
||||
if (trimmedCategory !== service.category) patch.category = trimmedCategory;
|
||||
return patchService(service.id, patch);
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["services"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["categories"] });
|
||||
|
||||
Reference in New Issue
Block a user