Add sponsorship pre validate endpoint (#564)

This commit is contained in:
Matt Gibson 2021-11-24 14:19:03 -06:00 committed by GitHub
parent 340a79bfe6
commit d02fcd082e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -458,6 +458,7 @@ export abstract class ApiService {
postCreateSponsorship: (sponsorshipOrgId: string, request: OrganizationSponsorshipCreateRequest) => Promise<void>;
deleteRevokeSponsorship: (sponsoringOrganizationId: string) => Promise<void>;
deleteRemoveSponsorship: (sponsoringOrgId: string) => Promise<void>;
postPreValidateSponsorshipToken: (sponsorshipToken: string) => Promise<boolean>;
postRedeemSponsorship: (sponsorshipToken: string, request: OrganizationSponsorshipRedeemRequest) => Promise<void>;
postResendSponsorshipOffer: (sponsoringOrgId: string) => Promise<void>;

View File

@ -1579,6 +1579,13 @@ export class ApiService implements ApiServiceAbstraction {
'/organization/sponsorship/sponsored/' + sponsoringOrgId,
null, true, false);
}
async postPreValidateSponsorshipToken(sponsorshipToken: string): Promise<boolean> {
const r = await this.send('POST', '/organization/sponsorship/validate-token?sponsorshipToken=' + encodeURIComponent(sponsorshipToken),
null, true, true);
return r as boolean;
}
async postRedeemSponsorship(sponsorshipToken: string, request: OrganizationSponsorshipRedeemRequest): Promise<void> {
return await this.send('POST', '/organization/sponsorship/redeem?sponsorshipToken=' + encodeURIComponent(sponsorshipToken),
request, true, false);