Skip to content

Commit

Permalink
feedback to NativePHP#39
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Sep 16, 2024
1 parent fe65cb3 commit 9662178
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/server/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export async function appendCookie() {
}

export async function notifyLaravel(endpoint: string, payload = {}) {

if (endpoint === 'events') {
broadcastToWindows('native-event', payload);
}

try {
await axios.post(
`http://127.0.0.1:${state.phpPort}/_native/api/${endpoint}`,
Expand All @@ -25,10 +30,6 @@ export async function notifyLaravel(endpoint: string, payload = {}) {
} catch (e) {
//
}

if (endpoint === 'events') {
broadcastToWindows('native-event', payload);
}
}

export function broadcastToWindows(event, payload) {
Expand Down

0 comments on commit 9662178

Please sign in to comment.