Skip to content

Commit c32d4d2

Browse files
author
Blaize Kaye
committed
Adds slightly stricter typing to pending changes
1 parent 98f5df8 commit c32d4d2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

services/api/src/resources/environment/environment_redeploy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ import { RemoveData, DeployType, AuditType } from '@lagoon/commons/dist/types';
1919
import { AuditLog } from '../audit/types';
2020

2121

22+
export const environmentPendingChangeTypes = {
23+
ENVVAR: "ENVVAR",
24+
};
25+
2226
export const getPendingChangesByEnvironmentId: ResolverFn = async(
2327
{
2428
id
@@ -93,7 +97,7 @@ ORDER BY allenvs.envvar_updated DESC;
9397
const results = await query(sqlClientPool, sql, [envId, envId, envId, envId]);
9498

9599
const pendingChanges = results.map(row => {
96-
return {type:`${row.envvarSource} Environment Variable`, details: `Variable name: ${row.envvarName}`, date: row.envvarUpdated};
100+
return {type:environmentPendingChangeTypes.ENVVAR, details: `Variable name: ${row.envvarName} (source: ${row.envvarSource} )`, date: row.envvarUpdated};
97101
});
98102

99103
return pendingChanges;

services/api/src/typeDefs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,11 +904,15 @@ const typeDefs = gql`
904904
}
905905
906906
type EnvironmentPendingChanges {
907-
type: String
907+
type: EnvironmentPendingChangeType
908908
details: String
909909
date: String
910910
}
911911
912+
enum EnvironmentPendingChangeType {
913+
ENVVAR
914+
}
915+
912916
type EnvironmentHitsMonth {
913917
total: Int
914918
}

0 commit comments

Comments
 (0)