refactor
This commit is contained in:
parent
7ba421179f
commit
f42b8dffeb
|
@ -5,9 +5,9 @@ import { ElectronFile, WatchStoreType } from '../types';
|
|||
import { getElectronFile, getFilesFromDir } from '../services/fs';
|
||||
|
||||
export async function addWatchMapping(
|
||||
collectionName: string,
|
||||
rootFolderName: string,
|
||||
folderPath: string,
|
||||
hasMultipleFolders: boolean
|
||||
uploadStrategy: number
|
||||
) {
|
||||
let watchMappings = getWatchMappings();
|
||||
if (!watchMappings) {
|
||||
|
@ -27,8 +27,8 @@ export async function addWatchMapping(
|
|||
});
|
||||
|
||||
watchMappings.push({
|
||||
collectionName,
|
||||
hasMultipleFolders,
|
||||
rootFolderName,
|
||||
uploadStrategy,
|
||||
folderPath,
|
||||
files: [],
|
||||
});
|
||||
|
|
|
@ -46,11 +46,11 @@ export const watchStoreSchema: Schema<WatchStoreType> = {
|
|||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
collectionName: {
|
||||
rootFolderName: {
|
||||
type: 'string',
|
||||
},
|
||||
hasMultipleFolders: {
|
||||
type: 'boolean',
|
||||
uploadStrategy: {
|
||||
type: 'number',
|
||||
},
|
||||
folderPath: {
|
||||
type: 'string',
|
||||
|
|
|
@ -26,8 +26,8 @@ type FileMapping = {
|
|||
};
|
||||
|
||||
interface Mapping {
|
||||
collectionName: string;
|
||||
hasMultipleFolders: boolean;
|
||||
rootFolderName: string;
|
||||
uploadStrategy: number;
|
||||
folderPath: string;
|
||||
files: FileMapping[];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue