mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix: Allow query function to be called with undefined orgId, and handle it as an error
This commit is contained in:
@@ -168,8 +168,12 @@ export const projectDALFactory = (db: TDbClient) => {
|
||||
}
|
||||
};
|
||||
|
||||
const findProjectBySlug = async (slug: string, orgId: string) => {
|
||||
const findProjectBySlug = async (slug: string, orgId: string | undefined) => {
|
||||
try {
|
||||
if (!orgId) {
|
||||
throw new BadRequestError({ message: "Organization ID is required when querying with slugs" });
|
||||
}
|
||||
|
||||
const projects = await db(TableName.ProjectMembership)
|
||||
.where(`${TableName.Project}.slug`, slug)
|
||||
.where(`${TableName.Project}.orgId`, orgId)
|
||||
|
||||
Reference in New Issue
Block a user