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