From 41dde91aa5e6a5953f22258db6528263d5575bb2 Mon Sep 17 00:00:00 2001 From: Zibbp Date: Sat, 6 Jan 2024 19:21:50 +0000 Subject: [PATCH] feat(admin/channel): allow setting external id when creating channel --- src/components/Admin/Channels/Drawer.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Admin/Channels/Drawer.tsx b/src/components/Admin/Channels/Drawer.tsx index 2c0ce01..6e28751 100644 --- a/src/components/Admin/Channels/Drawer.tsx +++ b/src/components/Admin/Channels/Drawer.tsx @@ -18,6 +18,7 @@ import { IconHelpCircle, IconQuestionMark } from "@tabler/icons-react"; const AdminChannelDrawer = ({ handleClose, channel, mode }) => { const { handleSubmit } = useForm(); const [id, setId] = useState(channel?.id); + const [externalId, setExternalId] = useState(channel?.external_id); const [name, setName] = useState(channel?.name); const [displayName, setDisplayName] = useState(channel?.display_name); const [imagePath, setImagePath] = useState(channel?.image_path); @@ -70,6 +71,7 @@ const AdminChannelDrawer = ({ handleClose, channel, mode }) => { method: "POST", url: `/api/v1/channel`, data: { + ext_id: externalId, name: name, display_name: displayName, image_path: imagePath, @@ -133,6 +135,15 @@ const AdminChannelDrawer = ({ handleClose, channel, mode }) => { disabled mb="xs" /> + {mode == "create" && ( + setExternalId(e.currentTarget.value)} + placeholder="External ID (auto generated if left blank)" + label="External ID" + mb="xs" + /> + )} setName(e.currentTarget.value)}