Bug/speech backwards compatibility (#203)

* add /Accounts api call back

* add /accounts call back

* include sp user into check

---------

Co-authored-by: EgleHelms <e.helms@cognigy.com>
This commit is contained in:
EgleH
2023-02-14 21:34:11 +01:00
committed by GitHub
parent 7890b7031f
commit c09ce5947e
@@ -87,7 +87,10 @@ export const SpeechServices = () => {
useEffect(() => {
setLocation();
if (currentServiceProvider) {
if (user?.scope !== USER_ACCOUNT && accountSid) {
setApiUrl(`Accounts/${accountSid}/SpeechCredentials`);
} else {
setApiUrl(
`ServiceProviders/${currentServiceProvider?.service_provider_sid}/SpeechCredentials`
);