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

Refactor admin search switch/case block #372

Open
gl2748 opened this issue Jun 19, 2018 · 0 comments
Open

Refactor admin search switch/case block #372

gl2748 opened this issue Jun 19, 2018 · 0 comments

Comments

@gl2748
Copy link
Contributor

gl2748 commented Jun 19, 2018

maybe refactor to use a general json filter handler & apply this handler to the fingerprint and metadata fields -- we'll have to do some error handling maybe, though
and
Ben:
Regarding all the cases starting here https://github.com/steemit/faucet/pull/364/files#diff-c3a36f0b10b2fd1722b9c20199e08e35R82 what do you think about having a general handler for json nested property filters, and just letting the user input any path they want for json column filters? (this includes the actions.metadata, users.fingerprint, and users.metadata cols as of now) a reusable handler would save quite a bit of code & can be applied for at least the users.metadata field immediately

Iain:

yes that makes sense.

            ```case 'fingerprint':
                andList.push({
                    fingerprint: where(
                        literal("fingerprint -> `$${some_user_input}`),
                        { [nRegexp]: value }
                    ),
                });
                break;```

where ${some_user_input} would be whatever they put after 'fingerprint'
ditto for metadata.
not looked at actions.

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

No branches or pull requests

1 participant