()
| 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(); |
nothing calls this directly
no test coverage detected