Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
feat(admin/channel): allow setting external id when creating channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibbp committed Jan 6, 2024
1 parent 9e6f34c commit 41dde91
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Admin/Channels/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -133,6 +135,15 @@ const AdminChannelDrawer = ({ handleClose, channel, mode }) => {
disabled
mb="xs"
/>
{mode == "create" && (
<TextInput
value={externalId}
onChange={(e) => setExternalId(e.currentTarget.value)}
placeholder="External ID (auto generated if left blank)"
label="External ID"
mb="xs"
/>
)}
<TextInput
value={name}
onChange={(e) => setName(e.currentTarget.value)}
Expand Down

0 comments on commit 41dde91

Please sign in to comment.