Skip to content

Commit

Permalink
dev/dust only for now
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanierh committed Nov 16, 2023
1 parent f2a6103 commit 9f9d477
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { NextApiRequest, NextApiResponse } from "next";
import { getDataSource } from "@app/lib/api/data_sources";
import { Authenticator, getAPIKey } from "@app/lib/auth";
import { CoreAPI, CoreAPIDatabase } from "@app/lib/core_api";
import { isDevelopmentOrDustWorkspace } from "@app/lib/development";
import { generateModelSId } from "@app/lib/utils";
import logger from "@app/logger/logger";
import { apiError, withLogging } from "@app/logger/withlogging";
Expand Down Expand Up @@ -51,6 +52,11 @@ async function handler(
});
}

if (!isDevelopmentOrDustWorkspace(owner)) {
res.status(404).end();
return;
}

const dataSource = await getDataSource(auth, req.query.name as string);
if (!dataSource) {
return apiError(req, res, {
Expand Down

0 comments on commit 9f9d477

Please sign in to comment.