Add authentication optional api url parameter (#5803)

This commit is contained in:
martmull
2024-06-11 12:08:21 +02:00
committed by GitHub
parent af8c637355
commit 9307d206c5
4 changed files with 47 additions and 5 deletions

View File

@ -40,7 +40,7 @@ const requestDb = async (
endpoint = 'graphql',
) => {
const options = {
url: `${process.env.SERVER_BASE_URL}/${endpoint}`,
url: `${bundle.authData.apiUrl || process.env.SERVER_BASE_URL}/${endpoint}`,
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -81,7 +81,9 @@ export const requestDbViaRestApi = (
objectNamePlural: string,
) => {
const options = {
url: `${process.env.SERVER_BASE_URL}/rest/${objectNamePlural}?limit:3`,
url: `${
bundle.authData.apiUrl || process.env.SERVER_BASE_URL
}/rest/${objectNamePlural}?limit:3`,
method: 'GET',
headers: {
'Content-Type': 'application/json',