MCPcopy
hub / github.com/streetwriters/notesnook / cancel

Method cancel

packages/core/src/api/subscriptions.ts:95–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93 constructor(private readonly db: Database) {}
94
95 async cancel() {
96 const token = await this.db.tokenManager.getAccessToken();
97 const user = await this.db.user.getUser();
98 if (!token || !user) return;
99 const endpoint = isLegacySubscription(user)
100 ? `subscriptions/cancel`
101 : `subscriptions/v2/cancel`;
102 await http.post(`${hosts.SUBSCRIPTIONS_HOST}/${endpoint}`, null, token);
103 }
104
105 async pause() {
106 const token = await this.db.tokenManager.getAccessToken();

Callers

nothing calls this directly

Calls 3

isLegacySubscriptionFunction · 0.85
getAccessTokenMethod · 0.80
getUserMethod · 0.80

Tested by

no test coverage detected