Skip to content

Commit a592288

Browse files
JohnJohn
authored andcommitted
#255: Fix peer review
1 parent 1f39dfe commit a592288

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

server/main.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import express, { Express, Request, Response, NextFunction } from 'express'
22
import cors from "cors";
33
import { resolve } from "path";
4-
import { unlink, createWriteStream } from "fs";
54
const fs = require("fs");
65
const progress = require("request-progress");
76
const path = require("path");
@@ -133,14 +132,14 @@ function downloadModel(downloadUrl: string, fileName: string): void {
133132
fileName: fileName,
134133
};
135134
})
136-
.pipe(createWriteStream(destination));
135+
.pipe(fs.createWriteStream(destination));
137136
}
138137

139138
function deleteFile(filePath: string): Promise<void> {
140139
const userDataPath = appPath();
141140
const fullPath = resolve(userDataPath, filePath);
142141
return new Promise((resolve, reject) => {
143-
unlink(fullPath, function (err) {
142+
fs.unlink(fullPath, function (err: any) {
144143
if (err && err.code === "ENOENT") {
145144
reject(Error(`File does not exist: ${err}`));
146145
} else if (err) {

web/services/cloudNativeService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { toast } from 'react-toastify';
33
const API_BASE_PATH: string = "/api/v1";
44

55
export function openExternalUrl(url: string) {
6-
window?.open(url, '_blank');
6+
window?.open(url, '_blank');
77
}
88

99
export async function appVersion() {
@@ -22,7 +22,7 @@ export async function deleteFile(fileName: string) {
2222
return fetchApi("", "deleteFile", fileName).catch((err: Error) => { throw err });
2323
}
2424

25-
export async function fetchApi(modulePath: string, pluginFunc: string, args: any): Promise<any> {
25+
export async function fetchApi(modulePath: string, pluginFunc: string, args: any): Promise<any> {
2626
const response = await fetch(API_BASE_PATH + "/invokeFunction", {
2727
method: 'POST',
2828
body: JSON.stringify({ "modulePath": modulePath, "method": pluginFunc, "args": args }),

0 commit comments

Comments
 (0)