Skip to content

Commit

Permalink
refactor(sync): ✨ added a check before executing function
Browse files Browse the repository at this point in the history
I added the check in-case FiveM desides they want to refactor their API.
  • Loading branch information
kristian770 committed Jan 2, 2025
1 parent c93b095 commit 33ec748
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion integrations/sync/nui-dev/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export async function fetchNUI(eventName: NuiEvents, data = {}) {
body: JSON.stringify(data),
} as const;

const resourceName = GetParentResourceName();
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
const resourceName = GetParentResourceName ? GetParentResourceName() : "sna-sync";
const url = `https://${resourceName}/${eventName}`;
try {
const response = await fetch(url, options);
Expand Down

0 comments on commit 33ec748

Please sign in to comment.