From 4aa43bda2bca76a99815d43594b471759fd37750 Mon Sep 17 00:00:00 2001 From: Noritada Kobayashi Date: Thu, 8 Dec 2022 19:53:46 +0900 Subject: [PATCH] Update URLs in help messages for access token documentation (#12451) (h/t @oritada) --- src/util/ajax.js | 2 +- src/util/mapbox.js | 2 +- test/unit/util/ajax.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/ajax.js b/src/util/ajax.js index 6b174566eba..1c810d28cf7 100644 --- a/src/util/ajax.js +++ b/src/util/ajax.js @@ -77,7 +77,7 @@ export class AJAXError extends Error { url: string; constructor(message: string, status: number, url: string) { if (status === 401 && isMapboxHTTPURL(url)) { - message += ': you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes'; + message += ': you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes'; } super(message); this.status = status; diff --git a/src/util/mapbox.js b/src/util/mapbox.js index 41df377b128..4c3ea586eb1 100644 --- a/src/util/mapbox.js +++ b/src/util/mapbox.js @@ -192,7 +192,7 @@ export class RequestManager { } _makeAPIURL(urlObject: UrlObject, accessToken: string | null | void): string { - const help = 'See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes'; + const help = 'See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes'; const apiUrlObject = parseUrl(config.API_URL); urlObject.protocol = apiUrlObject.protocol; urlObject.authority = apiUrlObject.authority; diff --git a/test/unit/util/ajax.test.js b/test/unit/util/ajax.test.js index 0e4e7e8d397..910eb5bc8e9 100644 --- a/test/unit/util/ajax.test.js +++ b/test/unit/util/ajax.test.js @@ -82,7 +82,7 @@ test('ajax', (t) => { }); getJSON({url:'api.mapbox.com'}, (error) => { t.equal(error.status, 401); - t.equal(error.message, "Unauthorized: you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"); + t.equal(error.message, "Unauthorized: you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"); t.end(); }); window.server.respond();