Skip to content

Commit

Permalink
feat: support querying for disabled deploytargets
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jul 25, 2023
1 parent c301efa commit b4cadfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions services/api/src/resources/openshift/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@ export const deleteOpenshift: ResolverFn = async (

export const getAllOpenshifts: ResolverFn = async (
root,
args,
{ disabled },
{ sqlClientPool, hasPermission }
) => {
await hasPermission('openshift', 'viewAll');

return query(sqlClientPool, 'SELECT * FROM openshift');
if (disabled != null) {
return query(sqlClientPool, knex('openshift').where('disabled', disabled).toString());
}
return query(sqlClientPool, knex('openshift').toString());
};

export const getOpenshiftByProjectId: ResolverFn = async (
Expand Down
4 changes: 2 additions & 2 deletions services/api/src/typeDefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,11 +1190,11 @@ const typeDefs = gql`
"""
Returns all OpenShift Objects
"""
allOpenshifts: [Openshift]
allOpenshifts(disabled: Boolean): [Openshift]
"""
Returns all Kubernetes Objects
"""
allKubernetes: [Kubernetes]
allKubernetes(disabled: Boolean): [Kubernetes]
"""
Returns all Environments matching given filter (all if no filter defined)
"""
Expand Down

0 comments on commit b4cadfd

Please sign in to comment.