improve stats api upgrade required error message (#3747)

pull/3750/head r2024.02.01-341
RobertJoonas 3 years ago committed by GitHub
parent 625b2a2946
commit 51f0e406a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,7 +45,7 @@ defmodule PlausibleWeb.AuthorizeStatsApiPlug do
{:error, :upgrade_required} ->
H.payment_required(
conn,
"#{Plausible.Billing.Feature.StatsAPI.display_name()} is part of the Plausible Business plan. To get access to this feature, please upgrade your account."
"The account that owns this API key does not have access to Stats API. Please make sure you're using the API key of a subscriber account and that the subscription plan includes Stats API"
)
{:error, :site_locked} ->

@ -163,7 +163,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.AuthTest do
|> get("/api/v1/stats/aggregate", %{"site_id" => site.domain, "metrics" => "pageviews"})
|> assert_error(
402,
"Stats API is part of the Plausible Business plan. To get access to this feature, please upgrade your account."
"The account that owns this API key does not have access to Stats API."
)
end

Loading…
Cancel
Save