Last active
January 28, 2022 17:39
-
-
Save Gerst20051/b6557c55dbc8d80b3f6211b6428af700 to your computer and use it in GitHub Desktop.
Paw JS Scripts
This file contains 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
function evaluate(context) { | |
const request = context.getAllRequests().reverse().find(request => { | |
return request.name.includes('Create a new invitation (manual)'); | |
}); | |
const invitation_url = JSON.parse(request.getLastExchange().responseBody).invitation_url; | |
const url_parts = invitation_url.split('/'); | |
return url_parts[url_parts.length - 1]; | |
} |
This file contains 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
function evaluate(context) { | |
const request = context.getAllRequests().reverse().find(request => { | |
return request.name.includes('Create a new invitation (manual) (Domestic)'); | |
}); | |
const invitation_url = JSON.parse(request.getLastExchange().responseBody).invitation_url; | |
const url_parts = invitation_url.split('/'); | |
return url_parts.slice(3).join('/'); | |
} |
This file contains 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
function evaluate(context) { | |
const invitationUrl = '{LAST RESPONSE OF W/ KEYPATH "[0].invitation_url"}'; | |
return invitationUrl.split('/').reverse()[1]; | |
} |
This file contains 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
function evaluate(context) { | |
return context.getCurrentRequest().urlBase.includes('localhost') ? '' : '/v1/endpoint'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment