misc_pterodactyl-panel/resources/scripts/state/server/files.ts
2020-07-10 23:09:37 -07:00

17 lines
396 B
TypeScript

import { action, Action } from 'easy-peasy';
import { cleanDirectoryPath } from '@/helpers';
export interface ServerFileStore {
directory: string;
setDirectory: Action<ServerFileStore, string>;
}
const files: ServerFileStore = {
directory: '/',
setDirectory: action((state, payload) => {
state.directory = cleanDirectoryPath(payload);
}),
};
export default files;