mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
feat: add path to socket connection
This commit is contained in:
@@ -86,7 +86,7 @@ export default ({ app }) => {
|
|||||||
################################################
|
################################################
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
const io = new Server(server, {});
|
const io = new Server(server, { path: '/socket' });
|
||||||
|
|
||||||
// Set socket.io listeners.
|
// Set socket.io listeners.
|
||||||
io.on('connection', (socket) => {
|
io.on('connection', (socket) => {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ export function DashboardSockets() {
|
|||||||
const client = useQueryClient();
|
const client = useQueryClient();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
socket.current = io('ws://localhost:4000');
|
socket.current = io('/', { path: '/socket' });
|
||||||
|
|
||||||
socket.current.on('NEW_TRANSACTIONS_DATA', () => {
|
socket.current.on('NEW_TRANSACTIONS_DATA', () => {
|
||||||
client.invalidateQueries(t.ACCOUNTS);
|
client.invalidateQueries(t.ACCOUNTS);
|
||||||
client.invalidateQueries(t.ACCOUNT_TRANSACTION);
|
client.invalidateQueries(t.ACCOUNT_TRANSACTION);
|
||||||
|
|||||||
Reference in New Issue
Block a user