Add support for renaming files on the fly in the file manager
This commit is contained in:
parent
52115b5c77
commit
ff820f30ad
10 changed files with 230 additions and 37 deletions
|
@ -2,7 +2,7 @@ import http from '../http';
|
|||
import {filter, isObject} from 'lodash';
|
||||
// @ts-ignore
|
||||
import route from '../../../../../vendor/tightenco/ziggy/src/js/route';
|
||||
import {DirectoryContents} from "./types";
|
||||
import {DirectoryContentObject, DirectoryContents} from "./types";
|
||||
|
||||
/**
|
||||
* Get the contents of a specific directory for a given server.
|
||||
|
@ -12,10 +12,10 @@ export function getDirectoryContents(server: string, directory: string): Promise
|
|||
http.get(route('server.files', {server, directory}))
|
||||
.then((response) => {
|
||||
return resolve({
|
||||
files: filter(response.data.contents, function (o) {
|
||||
files: filter(response.data.contents, function (o: DirectoryContentObject) {
|
||||
return o.file;
|
||||
}),
|
||||
directories: filter(response.data.contents, function (o) {
|
||||
directories: filter(response.data.contents, function (o: DirectoryContentObject) {
|
||||
return o.directory;
|
||||
}),
|
||||
editable: response.data.editable,
|
||||
|
|
Reference in a new issue