From 0ac67323d3318b2212fe63c3fd0b6a2912947731 Mon Sep 17 00:00:00 2001 From: saeidex Date: Tue, 5 Nov 2024 11:36:46 +0600 Subject: [PATCH] refactor: rename location query --- apps/next/src/app/dashboard/buses/[busId]/page.tsx | 4 ++-- packages/mqtt/src/service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/next/src/app/dashboard/buses/[busId]/page.tsx b/apps/next/src/app/dashboard/buses/[busId]/page.tsx index e7fcb28..c8d1fda 100644 --- a/apps/next/src/app/dashboard/buses/[busId]/page.tsx +++ b/apps/next/src/app/dashboard/buses/[busId]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { MqttProvider, useMqttSubscription } from "@ubus/mqtt"; +import { MqttProvider, useBusLocationQuery } from "@ubus/mqtt"; interface BusLocationPageProps { params: { @@ -17,7 +17,7 @@ const BusLocationPage = (props: BusLocationPageProps) => { }; const BusLocationContent = (props: BusLocationPageProps) => { - const { data: location, error } = useMqttSubscription(props.params.busId); + const { data: location, error } = useBusLocationQuery(props.params.busId); // if (isLoading) return

Loading...

; if (error) diff --git a/packages/mqtt/src/service.ts b/packages/mqtt/src/service.ts index 802bb13..32db75a 100644 --- a/packages/mqtt/src/service.ts +++ b/packages/mqtt/src/service.ts @@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/react-query"; import { mqttClient as client } from "./client"; import { getBusLocationTopic } from "./topics"; -export const useMqttSubscription = (busId: string) => { +export const useBusLocationQuery = (busId: string) => { const topic = getBusLocationTopic(busId); return useQuery({