@amedia/user 0.14.10 → 0.14.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -23,10 +23,13 @@ describe('activateSubscription()', () => {
|
|
|
23
23
|
it('should return list if access features even if requested access is not "granted"', async () => {
|
|
24
24
|
fetch.mockResponse(
|
|
25
25
|
JSON.stringify({
|
|
26
|
-
status: '
|
|
26
|
+
status: 'subscription_not_found',
|
|
27
27
|
access: 'denied',
|
|
28
28
|
access_features: ['newspaper'],
|
|
29
|
-
})
|
|
29
|
+
}),
|
|
30
|
+
{
|
|
31
|
+
status: 400,
|
|
32
|
+
}
|
|
30
33
|
);
|
|
31
34
|
await expect(
|
|
32
35
|
activateSubscription(['newspaper'], 'www.telen.no')
|
package/src/clients/mercury.ts
CHANGED
|
@@ -36,7 +36,7 @@ export const activateSubscription = async (
|
|
|
36
36
|
throw new UserDeactivatedError();
|
|
37
37
|
}
|
|
38
38
|
if (EXPECTED_ERRORS.includes(data?.status)) {
|
|
39
|
-
return [];
|
|
39
|
+
return data?.access_features || [];
|
|
40
40
|
}
|
|
41
41
|
log.error(
|
|
42
42
|
`Activate subscription failed. Mercury (HTTP/${response.status}: ${body})`,
|