Created
October 20, 2019 15:29
-
-
Save chankanzu/1643fd9ee2f64ec9aa6c3b72aa1d97f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let obj=JSON.parse($response.body) | |
| let url = $request.url; | |
| var cons1 = "me"; | |
| var cons2 = "dashboard"; | |
| var cons3 = "leaderboard"; | |
| if(url.indexOf(cons1) != -1) | |
| { | |
| obj["profile"]["is_pro"]=true; | |
| body= JSON.stringify(obj); | |
| } | |
| if(url.indexOf(cons2) != -1) | |
| { | |
| obj["user"].is_premium= true; | |
| body= JSON.stringify(obj); | |
| } | |
| if(url.indexOf(cons3) != -1) | |
| { | |
| obj["users"][0].is_premium= true; | |
| body= JSON.stringify(obj); | |
| } | |
| $done({body}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment