Skip to content

Commit

Permalink
Cleaning up following @spolu's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
lasryaric committed Apr 4, 2024
1 parent 09f3de4 commit 881e151
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
20 changes: 6 additions & 14 deletions front/pages/api/w/[wId]/data_sources/[name]/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ async function handler(
},
});
}
if (!auth.user()) {

if (!auth.isBuilder()) {
return apiError(req, res, {
status_code: 404,
status_code: 403,
api_error: {
type: "workspace_user_not_found",
message: "Could not find the user of the current session.",
type: "data_source_auth_error",
message:
"Only the users that are `builders` for the current workspace can access Data Source configuration.",
},
});
}
Expand All @@ -59,16 +61,6 @@ async function handler(
});
}

if (!auth.isBuilder()) {
return apiError(req, res, {
status_code: 403,
api_error: {
type: "data_source_auth_error",
message:
"Only the users that are `builders` for the current workspace can access Data Source configuration.",
},
});
}
if (!dataSource.connectorProvider || !dataSource.connectorId) {
return apiError(req, res, {
status_code: 404,
Expand Down
2 changes: 1 addition & 1 deletion front/pages/api/w/[wId]/data_sources/managed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ async function handler(
owner.sId,
systemAPIKeyRes.value.secret,
dataSourceName,
connectionId || "n/a",
connectionId || "none",
configuration
);

Expand Down

0 comments on commit 881e151

Please sign in to comment.