Skip to content

Commit

Permalink
feat: add buildimage boolean to allprojects query
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Nov 8, 2023
1 parent 40bb218 commit e09177d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion services/api/src/resources/project/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const getProjectDeployKey: ResolverFn = async (

export const getAllProjects: ResolverFn = async (
root,
{ order, createdAfter, gitUrl },
{ order, createdAfter, gitUrl, buildImage },
{ sqlClientPool, hasPermission, models, keycloakGrant, keycloakUsersGroups }
) => {
let userProjectIds: number[];
Expand Down Expand Up @@ -99,6 +99,10 @@ export const getAllProjects: ResolverFn = async (
queryBuilder = queryBuilder.andWhere('git_url', gitUrl);
}

if (buildImage) {
queryBuilder = queryBuilder.and.whereNot('build_image', '');
}

if (userProjectIds) {
queryBuilder = queryBuilder.whereIn('id', userProjectIds);
}
Expand Down
2 changes: 1 addition & 1 deletion services/api/src/typeDefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ const typeDefs = gql`
"""
Returns all Project Objects matching given filters (all if no filter defined)
"""
allProjects(createdAfter: String, gitUrl: String, order: ProjectOrderType): [Project]
allProjects(createdAfter: String, gitUrl: String, order: ProjectOrderType, buildImage: Boolean): [Project]
"""
Returns all Project Objects matching metadata filters
"""
Expand Down

0 comments on commit e09177d

Please sign in to comment.