Skip to content

Commit

Permalink
Revert "Fix graphql tryout loading issue"
Browse files Browse the repository at this point in the history
  • Loading branch information
SachiniSiriwardene authored Dec 4, 2024
1 parent dc2a08f commit 8300c59
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ passport.deserializeUser((user, done) => {

app.use(constants.ROUTE.STYLES, express.static(path.join(process.cwd(), filePrefix + 'styles')));
app.use(constants.ROUTE.IMAGES, express.static(path.join(process.cwd(), filePrefix + 'images')));
app.use(constants.ROUTE.INTERNAL_STYLES, express.static(path.join(process.cwd(), 'src/pages/styles')));

//backend routes
app.use(constants.ROUTE.DEV_PORTAL, devportalRoute);
Expand Down
1 change: 0 additions & 1 deletion src/db/sequelize.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const sequelize = new Sequelize(
{
host: config.db.host,
dialect: config.db.dialect,
logging: false,
pool: {
max: 5,
min: 0,
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions src/pages/tryout/page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{else if (eq apiType "AsyncAPI")}}

<head>
<link rel="stylesheet" href="/internalStyles/async-tryout.css">
<link rel="stylesheet" href="/styles/async-tryout.css">
</head>
<main>
<div id="asyncapi"></div>
Expand All @@ -37,10 +37,9 @@
<div id="root" style="height: 100vh;"></div>

<script>
const fetcher = GraphiQL.createFetcher({ url: '{{ apiMetadata.endPoints.productionUrl }}' });
const fetcher = GraphiQL.createFetcher({ url: '{{ apiMetadata.serverUrl.sandboxUrl }}' });
const rootElement = document.getElementById('root');
const root = ReactDOM.createRoot(rootElement);
console.log(fetcher);
root.render(
React.createElement(GraphiQL, {
fetcher: fetcher,
Expand Down
6 changes: 3 additions & 3 deletions src/services/apiMetadataService.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ const createAPIMetadata = async (req, res) => {

const getAPIMetadata = async (req, res) => {

const { orgId, apiId } = req.params;
if (!orgId || !apiId) {
const { orgID, apiID } = req.params;
if (!orgID || !apiID) {
throw new Sequelize.ValidationError(
"Missing or Invalid fields in the request payload"
);
}
try {
const retrievedAPI = await getMetadataFromDB(orgId, apiId);
const retrievedAPI = await getMetadataFromDB(orgID, apiID);
// Create response object
res.status(200).send(retrievedAPI);
} catch (error) {
Expand Down
1 change: 0 additions & 1 deletion src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ module.exports = {
ROUTE: {
DEV_PORTAL: '/devportal',
STYLES: '/styles',
INTERNAL_STYLES: '/internalStyles',
IMAGES: '/images',
IMAGES_PATH: '/images/',
DEFAULT: '/',
Expand Down

0 comments on commit 8300c59

Please sign in to comment.