From 27113db820440da2552b510da4c05945380f888f Mon Sep 17 00:00:00 2001 From: Zaptoss Date: Mon, 8 Jul 2024 20:04:45 +0300 Subject: [PATCH] Write docs. Remove comments --- .gitignore | 1 + README.md | 7 +++++-- internal/service/handlers/create_balance.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 07831c8..fb1a325 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ docker-compose.yaml docs/node_modules docs/web_deploy vendor/ +configs \ No newline at end of file diff --git a/README.md b/README.md index 0f909c6..7aa2574 100644 --- a/README.md +++ b/README.md @@ -42,20 +42,23 @@ Body: ```json { "nullifier": "0x0000000000000000000000000000000000000000000000000000000000000000", - "count": 2 + "count": 2, + "infinity": true } ``` Response: ```json { "referral": "kPRQYQUcWzW", - "usage_left": 2 + "usage_left": 2, + "infinity": true } ``` Parameters: - `nullifier` - nullifier to create or edit referrals for - `count` - number of referral usage +- `infinity` - specify if referrals code have unlimited usage count ### Local build diff --git a/internal/service/handlers/create_balance.go b/internal/service/handlers/create_balance.go index bde7506..efb61f0 100644 --- a/internal/service/handlers/create_balance.go +++ b/internal/service/handlers/create_balance.go @@ -39,7 +39,7 @@ func CreateBalance(w http.ResponseWriter, r *http.Request) { return } - referral, err := ReferralsQ(r).FilterInactive().Get(req.Data.Attributes.ReferredBy) // infinite referrals allowed + referral, err := ReferralsQ(r).FilterInactive().Get(req.Data.Attributes.ReferredBy) if err != nil { Log(r).WithError(err).Error("Failed to get referral by ID") ape.RenderErr(w, problems.InternalError())