Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved AddSharedAccount function #14

Merged
merged 6 commits into from
Feb 20, 2025
Merged

Conversation

t1ger-scripts
Copy link
Contributor

Improved the AddSharedAccount() function. Now returns boolean with message. Added checks to validate parsed parameters. Also check for database insertion.

Removed exports from fxmanifest (as suggested earlier) and added directly inside server/main.lua

Added parameter checks. Database insert checks. Returns boolean and error message if needed.
removed exports from fxmanifest and added inside server/main.lua
Instead of returning "success" it now returns the account on success
@Kenshiin13 Kenshiin13 changed the base branch from main to dev February 18, 2025 21:38
Copy link

@Kenshiin13 Kenshiin13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know how to feel about returning error reasons/messages. I don't see how that would be of use to third-party resources. I think you should just throw an error instead.

- Changed return value from `true/false` to return the account table on success and `nil` on failure.
- Error if parameters or DB insertion are not success.
- Removed redundant checks
@t1ger-scripts
Copy link
Contributor Author

Corrected

Copy link

@Kenshiin13 Kenshiin13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@Kenshiin13 Kenshiin13 merged commit 0ddd21c into esx-framework:dev Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Next Update
Development

Successfully merging this pull request may close these issues.

2 participants