fix(command): fix value command
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
@@ -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: "" }),
|
||||||
|
|||||||
2
src/repositories/device/types.d.ts
vendored
2
src/repositories/device/types.d.ts
vendored
@@ -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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user