Skip to content

Commit

Permalink
Fix codeclimate issue (gitlabDigitalTwin)
Browse files Browse the repository at this point in the history
  • Loading branch information
VanessaScherma committed Oct 27, 2024
1 parent 15654df commit b6dff7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions client/src/preview/util/digitalTwinUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FileState } from "preview/store/file.slice";
import GitlabInstance from "./gitlab";
import DigitalTwin from "./gitlabDigitalTwin";

export function isValidInstance(digitalTwin: DigitalTwin): boolean {
Expand Down Expand Up @@ -36,14 +35,13 @@ export function getCommitMessage(file: FileState): string {
}

export async function createFile(
gitlabInstance: GitlabInstance,
projectId: number,
digitalTwin: DigitalTwin,
file: FileState,
filePath: string,
commitMessage: string
): Promise<void> {
await gitlabInstance.api.RepositoryFiles.create(
projectId,
await digitalTwin.gitlabInstance.api.RepositoryFiles.create(
digitalTwin.gitlabInstance.projectId!,
`${filePath}/${file.name}`,
'main',
file.content,
Expand Down
2 changes: 1 addition & 1 deletion client/src/preview/util/gitlabDigitalTwin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class DigitalTwin {
const filePath = getFilePath(file, mainFolderPath, lifecycleFolderPath);
const commitMessage = getCommitMessage(file);

await createFile(this.gitlabInstance, this.gitlabInstance.projectId, file, filePath, commitMessage);
await createFile(this, file, filePath, commitMessage);
}
}

Expand Down

0 comments on commit b6dff7d

Please sign in to comment.