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

Fixed order of arguments in If Statements #83

Closed
wants to merge 4 commits into from
Closed

Fixed order of arguments in If Statements #83

wants to merge 4 commits into from

Conversation

richardhaddadau
Copy link

@richardhaddadau richardhaddadau commented May 23, 2022

Current Issue

The IF statements on a few files seem to have the arguments in the wrong order and I've only made the change in the setup/accounts.js file to confirm that I've understood it correctly before running with the changes to the rest of the files.

Proposed Fix

As I understand it, the If statement works as follows:
If(condition, true, false)

In that case, when we are deleting a collection or index, we're checking if it exists so:

// In PseudoCode
If(Collection Exists, Delete it, Otherwise return true)

// Or, in FQL
If(Exists(Collection('accounts')), Delete(Collection('accounts')), true)

Other Comments

The way it's currently stated in the files, nothing will be deleted since when the collection or index exists, it simply returns true.

@richardhaddadau richardhaddadau closed this by deleting the head repository Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant