fix(command): fix value command

This commit is contained in:
2026-02-09 11:15:29 +07:00
parent 4384c355f9
commit ff51bd437a
3 changed files with 6 additions and 8 deletions

View File

@@ -33,7 +33,7 @@ export default function TopicsFeature() {
setError(""); setError("");
setForm({ setForm({
topic: "", topic: "",
type: tab === "state" ? "state-reply" : "commands", type: tab === "state" ? "state-reply" : "command",
}); });
setIsOpen(true); setIsOpen(true);
}; };
@@ -58,7 +58,7 @@ export default function TopicsFeature() {
setIsOpen(false); setIsOpen(false);
setForm({ setForm({
topic: "", topic: "",
type: tab === "state" ? "state-reply" : "commands", type: tab === "state" ? "state-reply" : "command",
}); });
}, },
onError: () => { onError: () => {
@@ -159,12 +159,10 @@ export default function TopicsFeature() {
} }
> >
<option value="state-reply">state-reply</option> <option value="state-reply">state-reply</option>
<option value="commands">commands</option> <option value="command">command</option>
</select> </select>
</label> </label>
{error && ( {error && <p className="text-sm text-red-500">{error}</p>}
<p className="text-sm text-red-500">{error}</p>
)}
<div className="mt-2 flex justify-end gap-2"> <div className="mt-2 flex justify-end gap-2">
<button <button
type="button" type="button"

View File

@@ -24,7 +24,7 @@ export default function CommandSection() {
const handleConfirmDelete = () => { const handleConfirmDelete = () => {
if (!pending.topic || deleteTopic.isPending) return; if (!pending.topic || deleteTopic.isPending) return;
deleteTopic.mutate( deleteTopic.mutate(
{ topic: pending.topic, type: "commands" }, { topic: pending.topic, type: "command" },
{ {
onSuccess: () => setPending({ open: false, topic: "" }), onSuccess: () => setPending({ open: false, topic: "" }),
onError: () => setPending({ open: false, topic: "" }), onError: () => setPending({ open: false, topic: "" }),

View File

@@ -54,7 +54,7 @@ type TopicData = {
type TopicPayload = { type TopicPayload = {
topic: string; topic: string;
type: "state-reply" | "commands"; type: "state-reply" | "command";
}; };
type TopicMutationResponse = { type TopicMutationResponse = {