Please see the below image for the illustration:

@deshraj can I take this?
@Ram81 yes sure. go ahead
@RishabhJain2018 you haven't created an entry for each new challenge's Star Challenge model. That's why when we try to fetch initially we can't get any message on the button.
For now I have done changes in controller & whenever we get an error fetching star challenge for any challenge I've set the message as 'Star'
@Ram81 I didn't get your point of creating the entry. Can you please explain a bit further ?
@RishabhJain2018 whenever you create a challenge there is no record entry made in 'Star Challenge' model that's why whenever the user opens the challenge page before being starred by anyone we can't fetch any entry for the particular challenge from 'Star Challenge'.
Did you get my point?
I suggest for each challenge you create an entry in 'Star Challenge' with initial values as 0 stars.
@Ram81 Just initialise star count with 0 at the start of controller and it will solve the problem.
@RishabhJain2018 please change the star count variable name from 'count' to 'starCount'.
@aka-jain count variable is being fetched from response that's why initially when there is no record of star challenge it fails. And this bug occurs only once, suppose if a person stars a challenge then he "unstar's" it then controller returns 0 as expected
Got your point @Ram81 , @RishabhJain2018 please do the require changes.
Also @Ram81 it will be good if we initialise the count variable with 0 value. Otherwise it might create problem somewhere.
@aka-jain Sure I will do it.
@Ram81 I think we can handle it using the back-end case.Please refer PR #1239 for further details.
@aka-jain We can easily handle it using the back-end case. Please check PR #1239 for further details.
@RishabhJain2018 should I close this one #1235 then? & actually I wanted to complete this one!
But I will take another issue.
@Ram81 Yes you can take up any other issue :). I will take care of this issue.
Moreover, we are glad to see your contributions and dedication!