feat: add remote update function
This commit is contained in:
20
src/Common.ts
Normal file
20
src/Common.ts
Normal 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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user