mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 21:51:56 +00:00
cleanup
This commit is contained in:
@@ -215,29 +215,26 @@ export const projectEnvServiceFactory = ({
|
||||
}
|
||||
};
|
||||
|
||||
const getEnvironmentById = async ({ projectId, actor, actorId, actorOrgId, actorAuthMethod, id }: TGetEnvDTO) => {
|
||||
const getEnvironmentById = async ({ actor, actorId, actorOrgId, actorAuthMethod, id }: TGetEnvDTO) => {
|
||||
const environment = await projectEnvDAL.findById(id);
|
||||
|
||||
if (!environment) {
|
||||
throw new NotFoundError({
|
||||
message: "Environment does not exist"
|
||||
});
|
||||
}
|
||||
|
||||
const { permission } = await permissionService.getProjectPermission(
|
||||
actor,
|
||||
actorId,
|
||||
projectId,
|
||||
environment.projectId,
|
||||
actorAuthMethod,
|
||||
actorOrgId
|
||||
);
|
||||
|
||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Environments);
|
||||
|
||||
const [env] = await projectEnvDAL.find({
|
||||
id,
|
||||
projectId
|
||||
});
|
||||
|
||||
if (!env) {
|
||||
throw new NotFoundError({
|
||||
message: "Environment does not exist"
|
||||
});
|
||||
}
|
||||
|
||||
return env;
|
||||
return environment;
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -23,4 +23,4 @@ export type TReorderEnvDTO = {
|
||||
|
||||
export type TGetEnvDTO = {
|
||||
id: string;
|
||||
} & TProjectPermission;
|
||||
} & Omit<TProjectPermission, "projectId">;
|
||||
|
||||
Reference in New Issue
Block a user