From d02fcd082edd8f94cff30d057644540eb6ccde87 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Wed, 24 Nov 2021 14:19:03 -0600 Subject: [PATCH] Add sponsorship pre validate endpoint (#564) --- common/src/abstractions/api.service.ts | 1 + common/src/services/api.service.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/common/src/abstractions/api.service.ts b/common/src/abstractions/api.service.ts index 06eb39e729..1c6aa0ef20 100644 --- a/common/src/abstractions/api.service.ts +++ b/common/src/abstractions/api.service.ts @@ -458,6 +458,7 @@ export abstract class ApiService { postCreateSponsorship: (sponsorshipOrgId: string, request: OrganizationSponsorshipCreateRequest) => Promise; deleteRevokeSponsorship: (sponsoringOrganizationId: string) => Promise; deleteRemoveSponsorship: (sponsoringOrgId: string) => Promise; + postPreValidateSponsorshipToken: (sponsorshipToken: string) => Promise; postRedeemSponsorship: (sponsorshipToken: string, request: OrganizationSponsorshipRedeemRequest) => Promise; postResendSponsorshipOffer: (sponsoringOrgId: string) => Promise; diff --git a/common/src/services/api.service.ts b/common/src/services/api.service.ts index 97145297db..46fdc1391e 100644 --- a/common/src/services/api.service.ts +++ b/common/src/services/api.service.ts @@ -1579,6 +1579,13 @@ export class ApiService implements ApiServiceAbstraction { '/organization/sponsorship/sponsored/' + sponsoringOrgId, null, true, false); } + + async postPreValidateSponsorshipToken(sponsorshipToken: string): Promise { + 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 { return await this.send('POST', '/organization/sponsorship/redeem?sponsorshipToken=' + encodeURIComponent(sponsorshipToken), request, true, false);