feat: add remote update function

This commit is contained in:
2025-05-14 21:22:20 +08:00
parent 48ae3b5975
commit 00ce79fa7b
6 changed files with 520 additions and 283 deletions

20
src/Common.ts Normal file
View File

@@ -0,0 +1,20 @@
import { type FileParameter } from "./APIClient";
import { isNull, isUndefined } from "lodash";
export namespace Common {
export function toFileParameter(object: File): FileParameter {
return {
data: object,
fileName: object.name
}
}
export function toFileParameterOrNull(object?: File | null): FileParameter | null {
if (isNull(object) || isUndefined(object)) return null;
else return {
data: object,
fileName: object.name
}
}
}