mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-02 14:39:16 +00:00
Checkpoint
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/09b482a5-aeec-4917-8600-40452d41807a.jpg
This commit is contained in:
@@ -318,12 +318,22 @@ export default function GroupsPage() {
|
||||
|
||||
// Form handlers
|
||||
const onCreateGroupSubmit = (data: GroupFormValues) => {
|
||||
createGroupMutation.mutate(data);
|
||||
// Handle "none" value for parentGroupId
|
||||
const submissionData = {
|
||||
...data,
|
||||
parentGroupId: data.parentGroupId === "none" ? undefined : data.parentGroupId
|
||||
};
|
||||
createGroupMutation.mutate(submissionData);
|
||||
};
|
||||
|
||||
const onEditGroupSubmit = (data: GroupFormValues) => {
|
||||
if (selectedGroup) {
|
||||
updateGroupMutation.mutate({ id: selectedGroup.id, data });
|
||||
// Handle "none" value for parentGroupId
|
||||
const submissionData = {
|
||||
...data,
|
||||
parentGroupId: data.parentGroupId === "none" ? undefined : data.parentGroupId
|
||||
};
|
||||
updateGroupMutation.mutate({ id: selectedGroup.id, data: submissionData });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -337,7 +347,7 @@ export default function GroupsPage() {
|
||||
editGroupForm.reset({
|
||||
name: group.name,
|
||||
description: group.description || "",
|
||||
parentGroupId: group.parentGroupId || undefined,
|
||||
parentGroupId: group.parentGroupId || "none",
|
||||
});
|
||||
setIsEditGroupOpen(true);
|
||||
};
|
||||
@@ -724,7 +734,7 @@ export default function GroupsPage() {
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="">None</SelectItem>
|
||||
<SelectItem value="none">None</SelectItem>
|
||||
{groups.map((group) => (
|
||||
<SelectItem key={group.id} value={group.id}>
|
||||
{group.name}
|
||||
@@ -810,7 +820,7 @@ export default function GroupsPage() {
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="">None</SelectItem>
|
||||
<SelectItem value="none">None</SelectItem>
|
||||
{availableParentGroups.map((group) => (
|
||||
<SelectItem key={group.id} value={group.id}>
|
||||
{group.name}
|
||||
|
||||
Reference in New Issue
Block a user