Conversation
| } | ||
|
|
||
| return { | ||
| accounts: accountRes.length ? Number(accountRes[0].accounts) : 0, |
There was a problem hiding this comment.
I like to avoid using numbers in boolean contexts (where 0 is falsy and >0 is truthy), because it can be a foot-gun
In this case I'd just do accounts: Number(accountRes[0].accounts ?? 0)
There was a problem hiding this comment.
i agree with you on not doing truey integers, but i don't think im doing that here. if !accountRes.length, then there are 0 accounts
also im not sure i understand the difference in your two examples
| component: Account | ||
| } | ||
| }, | ||
| Stats: { |
There was a problem hiding this comment.
We'll need to give some thought to how to prevent this from showing up for regular users. I'm thinking for now maybe VIEWS becomes dynamic, and factors in our hardcoded list of admin account IDs?
But there is a bigger discussion to be had around, if budibase won't serve all of our admin needs, should we a) look for an alternate service or b) modify our core systems and schemas to properly handle different access levels for admin users?
There was a problem hiding this comment.
yea this is my core question. there's a also a third option to use something that's meant for dashboards/reports such as https://github.com/metabase/metabase
(why is everything called ____base???)
There was a problem hiding this comment.
partially i did this to get into the codebase a bit. ty for the comments, will fix what you pointed out
No description provided.