Skip to content

Commit 8b69678

Browse files
committed
feat(file names): change file names based on the service
1 parent d14f786 commit 8b69678

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

web/src/utils/nameGenerator.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Endpoints } from "../features/constants";
2+
3+
export const nameGenerator = (endpoint: Endpoints | "") => {
4+
let name = "Terraform";
5+
switch (endpoint) {
6+
case Endpoints.POST_IAC_T_DOCKER:
7+
name = `${name}_Docker`;
8+
break;
9+
case Endpoints.POST_IAC_T_EC2:
10+
name = `${name}_EC2`;
11+
break;
12+
case Endpoints.POST_IAC_T_S3:
13+
name = `${name}_S3`;
14+
break;
15+
case Endpoints.POST_IAC_T_IAM:
16+
name = `${name}_IAM`;
17+
break;
18+
}
19+
return name;
20+
};

web/src/utils/store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { create } from "zustand";
2-
import { UserType } from "../features/constants";
2+
import { Endpoints, UserType } from "../features/constants";
33
import { Message } from "../features/model";
44

55
interface GeneratorQuery {
66
isSuccess: boolean;
7-
endpoint: string;
7+
endpoint: Endpoints | "";
88
}
99

1010
interface DevOpsStore {
@@ -17,7 +17,7 @@ interface DevOpsStore {
1717
resetMessages: () => void;
1818

1919
generatorQuery: GeneratorQuery;
20-
setGeneratorQuery: (isSuccess: boolean, endpoint: string) => void;
20+
setGeneratorQuery: (isSuccess: boolean, endpoint: Endpoints | "") => void;
2121
}
2222

2323
const initialState: Pick<

0 commit comments

Comments
 (0)