Extension of already existing plugins
The balance plugin already creates a db table but the api just takes row and page parameter in request body. Now if I need to extend this plugins' already existing feature by adding account search how do I go about it. I tried adding a new route within the balance plugin https://github.com/itering/subscan-essentials/blob/master/plugins/balance/http/http.go#L18 but data is not being queried through and modification in one route's function affected the other.
You just need to add a new route to https://github.com/itering/subscan-essentials/blob/65a62200b6277ff02d38d50bc0658cc2df3aa16c/plugins/balance/http/http.go#L20 and write the query in this handle logic
Yeah i tried that and wrote a query similar to this https://github.com/itering/subscan-essentials/blob/master/plugins/system/dao/dao.go#L24
db.FindBy(&accountser, map[string]interface{}{"address": address}, nil) but the data it returns is nil and due to this the other account route also returns empty json when invoked.
Is the query in the above FindBy method correct or am i missing something?
[Update] Both routes work separately when the other is commented out but when both are present data is not returned properly.
return []router.Http{ {"accounts", accounts}, //{"findac", findac}, }
The accounts route returns multiple db table rows while findac return only one.
you can achieve this by using query parameters