Skip to content

Commit

Permalink
chore(service-messages): migrate to new api and hub
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysencpp committed Oct 31, 2024
1 parent dcee3e9 commit 0030f2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ServiceMessageProvider: FC<PropsWithChildren> = ({ children }) => {
serviceMessages.next(data);
}, [data]);

const topic = useSignalR<unknown[]>('portal', 'service-messages');
const topic = useSignalR<unknown[]>('servicemessages', 'service-messages');

useLayoutEffect(() => {
const sub = topic.pipe(map((x) => x.shift() as ServiceMessage[])).subscribe(serviceMessages);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { useQuery } from 'react-query';
import { ServiceMessage } from '../types/types';

export async function getActiveServiceMessages(client: IHttpClient): Promise<ServiceMessage[]> {
const res = await client.fetch(`/api/service-messages/active`);
const res = await client.fetch(`/service-messages/active`);
if (!res.ok) throw res;
return (await res.json()) as ServiceMessage[];
}

export const useServiceMessageQuery = () => {
const client = useFramework().modules.serviceDiscovery.createClient('portal');
const client = useFramework().modules.serviceDiscovery.createClient('service-messages');

return useQuery({
queryKey: ['service-message'],
Expand Down

0 comments on commit 0030f2d

Please sign in to comment.