A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
core: add api for redeeming gift codes
Abdullah Atta46d4b9dece2c
diff --git a/packages/core/src/api/subscriptions.ts b/packages/core/src/api/subscriptions.tsindex 72a625f70..601f7afa7 100644--- a/packages/core/src/api/subscriptions.ts+++ b/packages/core/src/api/subscriptions.ts@@ -90,4 +90,16 @@ export default class Subscriptions {token);}++ async redeemCode(code: string) {+ const token = await this.tokenManager.getAccessToken();+ if (!token) return;+ return http.post.json(+ `${hosts.SUBSCRIPTIONS_HOST}/subscriptions/redeem`,+ {+ code+ },+ token+ );+ }}diff --git a/packages/core/src/types.ts b/packages/core/src/types.tsindex 5a857f212..6587ecb28 100644--- a/packages/core/src/types.ts+++ b/packages/core/src/types.ts@@ -536,7 +536,7 @@ export type User = {cancelURL: string | null;expiry: number;productId: string;- provider: 0 | 1 | 2 | 3;+ provider: 0 | 1 | 2 | 3 | 4;start: number;type: 0 | 1 | 2 | 5 | 6 | 7;updateURL: string | null;