-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat(frontend): implements reward canister api #3996
feat(frontend): implements reward canister api #3996
Conversation
I randomly noticed this PR. Not sure if it's a general work in progress or effective implementation of a feature so just a heads-up: canister, API, and services should be provided in separate PRs, each covered by tests. |
@peterpeterparker atm it's just work in progress. But good to know, if it is finished, i will split them into different PRs |
…lements-reward-canister-api
…re(frontend)/implements-reward-canister-api
…lements-reward-canister-api # Conflicts: # src/frontend/src/lib/canisters/reward.canister.ts # src/frontend/src/tests/lib/canisters/reward.canister.spec.ts
@peterpeterparker now this PR is open and ready to be reviewed |
…lements-reward-canister-api # Conflicts: # src/frontend/src/lib/i18n/en.json # src/frontend/src/lib/types/i18n.d.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx
Reviewed offline together with @BonomoAlessandro. Few minor improvements will be provided within this PR after this approval as discussed to move forward.
adds a small doc to the update functions
…lements-reward-canister-api # Conflicts: # src/frontend/src/lib/i18n/en.json
# Motivation I reviewed the `reward-code.services` after merging #3996 and noticed a few areas that could be better aligned with the codebase's style and patterns for consistency. # Changes for Consistency - Add JSDoc comments for exported functions. - Use specific error classes instead of the generic `Error` when the error type is known. - Bubble the `err` in the `ResultSuccess` return to potentially inform the consumer about which error occurred. - Align the pattern of `updateVipReward` with the pattern of other internal functions in the service, `updateReward`, which throws errors instead of returning values. - Define `err` as `err: unknown`. # Opinionated Changes - Destructure parameters. # TODO - Add a TODO for `getNewReward` to use a `ResultSuccess` return type as well. --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Motivation
We want to use the
reward canister api
and thereward service
so that we can send some rewards to new or existing users.Changes